fix: sign actions should wait for preCallback completion before proceeding #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related PRs:
Description
In the PRs linked above we added a callback that could be passed in during identity creation that would be fired to notify when identity creation and enabling occurred.
However those callbacks were implemented in a way that merely notified that sign actions would occur without actually blocking the signing actions until the callbacks were finished.
For example, the preEventCallbacks in
xmtp-js
block signing actions until after callbacks are finished, which gives developers greater flexibility: https://github.com/xmtp/xmtp-js/blob/e96b2e214bef3965f703be09863fa8b2fb4552d2/src/Client.ts#L178-L194This change updates our code to wait until callbacks are completed before resuming identity sign request logic.
To Test
The following branch has changes from this PR cherry-picked on to a branch that has in progress code for connecting external wallets in the example app (via thirdweb-sdk + wallet connect): cameronvoell-callback-testing-wallet
Paths to check: