fix: callbacks in auth flow no longer unsubscribed too early #192
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.
Callbacks for identity creation and enabling were added recently in the following PR:
Though that PR's automated tests verified the flow worked with randomly generated identity flow, we did not have a External Wallet SDK signing to test against to verify that the callbacks returned as expected.
In progress work on connecting external wallets revealed that during the regular auth flow, we were unsubscribing from the. new callbacks too early.
The fix in this PR can be tested via the following test branch which has the fix in this PR as well as external wallet connect button: callbacks-test-branch-with-wallet-connect
In addition to moving the subscription removal to a later time, we also added error handling so that if a user rejects a signing request, that callback subscriptions are still removed as expected.