Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Conversation

@metabacalhau
Copy link
Contributor

Description

The subscription event callback is not being called due to the missing execution of the promise which leads to immediate unsubscribing from the events.

Is this PR related with an open issue?

Related to Issue #

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Follows the code style of this project.
  • Tests Cover Changes
  • Documentation

Funny gif

Put a link of a funny gif inside the parenthesis-->

@metabacalhau metabacalhau requested review from a team as code owners March 14, 2023 09:29
const subscribablePromise = subscribableAction()
subscription = onEvent ? subscribablePromise.subscribe(onEvent) : undefined
return subscribablePromise
return await subscribablePromise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is returning a promise anyway then await is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to execute the promise and return the result to the caller so that we can unsubscribe from the events inside this wrapper function when the promise is fulfilled or rejected.

@metabacalhau metabacalhau added this pull request to the merge queue Mar 14, 2023
Merged via the queue into main with commit 014b919 Mar 14, 2023
@metabacalhau metabacalhau deleted the fix/progress-event branch March 14, 2023 11:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants