Skip to content

Conversation

nathanosdev
Copy link
Contributor

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 requested a review from krpeacock April 22, 2023 10:55
@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
@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.

2 participants