Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: finish all tasks before calling onSuccess callback #714

Merged
merged 2 commits into from
May 1, 2023
Merged

fix: finish all tasks before calling onSuccess callback #714

merged 2 commits into from
May 1, 2023

Conversation

nathanosdev
Copy link
Member

Description

The onSuccess callback was called before writing the delegation chain to storage. Since the writing of the chain to storage is asynchronous, an app that performs some full page navigation or a page refresh in their onSuccess callback might interrupt the operation.

How Has This Been Tested?

This was causing flakiness in some e2e tests that I was working on for a dapp. Roughly 20% of the runs were failing. Making this change removes the flakiness and the tests pass now 100% of the time.

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@nathanosdev nathanosdev self-assigned this Apr 22, 2023
@krpeacock krpeacock requested a review from a team April 25, 2023 19:09
Copy link
Contributor

@krpeacock krpeacock left a comment

Choose a reason for hiding this comment

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

Nice - this is easier to read, as well!

@krpeacock krpeacock merged commit 1d35889 into dfinity:main May 1, 2023
14 checks passed
@nathanosdev nathanosdev deleted the nathan/finish-tasks-before-on-success-callback branch May 2, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants