-
Notifications
You must be signed in to change notification settings - Fork 88
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 multiple network setups for React Native SDKs #687
Merged
romin-halltari
merged 5 commits into
master
from
rominhalltari-sc-91530-investigate-and-provide-solution-for-issue
Dec 15, 2023
Merged
Fix multiple network setups for React Native SDKs #687
romin-halltari
merged 5 commits into
master
from
rominhalltari-sc-91530-investigate-and-provide-solution-for-issue
Dec 15, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ead of using checkIsReadyForRequest when isReadyForRequest is false
This pull request has been linked to Shortcut Story #91530: Investigate and provide solution for issue with switching networks on react native (Snowball.money). |
…vide-solution-for-issue
Ethella
previously approved these changes
Dec 15, 2023
Ethella
approved these changes
Dec 15, 2023
romin-halltari
deleted the
rominhalltari-sc-91530-investigate-and-provide-solution-for-issue
branch
December 15, 2023 23:11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📦 Pull Request
Previously, we were using
await this.checkIsReadyForRequest
before sending a request. Problem is, after first render, this promise will return immediately, even when the relayer is re-rendered. That is because we don't re-construct the controller each time a render happens (that's a no-op).This PR introduces the
isReadyForRequest
boolean which we can reset to false when the relayer is unmounted. That allows us to wait again until the WebView is ready for requests on re-mount.We still keep
checkIsReadyForRequest
because it is used for faster initial requests in browser environments.Before:
https://github.com/magiclabs/magic-js/assets/150072475/7c184022-7938-4a8b-a9ee-c6ac50ee281c
After:
https://github.com/magiclabs/magic-js/assets/150072475/003dcb69-9b1c-41c6-a5bd-1052a9204aca
[Provide a general summary of the pull request here.]
✅ Fixed Issues
Possible issue with Relayer initialization #610
🚨 Test instructions
[Describe any additional context required to test the PR/feature/bug fix.]
Please only add one label:
patch
: Bug Fix?minor
: New Feature?major
: Breaking Change?skip-release
: It's unnecessary to publish this change.📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: