-
Notifications
You must be signed in to change notification settings - Fork 43
SDK-478 resolve init promise immediately on iOS SDK, matching Android SDK #869
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
Open
joaodordio
wants to merge
4
commits into
master
Choose a base branch
from
fix/SDK-478-bridge-resolve-immediately
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−10
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
13fca39
✨ Updated the SDK initialize method
joaodordio 5db530b
Merge branch 'master' into fix/SDK-478-bridge-resolve-immediately
joaodordio b8a69dc
Merge branch 'master' into fix/SDK-478-bridge-resolve-immediately
joaodordio eb3c496
🧪 Increased the tests wait time to avoid flakyness from CI
joaodordio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell, we're not waiting for
Iterable.initialize2to return, though. It looks like we're bypassing any return and always resolving as true. Would this not silence any errors that may occur?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, but the callback was never an init-error signal. Two pieces of evidence from the iOS SDK source.
1.
IterableAPI.initialize(...)andinitialize2(...)run the same code, neither is failable.swift-sdk/SDK/IterableAPI.swift#L102-L108:The public sync
initialize(...)is justinitialize2(...)with no callback. Both returnVoid, nothrows, noResult. There is no init-error channel on the native API.2. The Bool the old bridge was awaiting represented the first in-app fetch, not init.
swift-sdk/SDK/IterableAPI.swift#L113-L128:start()isInAppManager.start(), which doesreturn scheduleSync(), the first in-app messages fetch. So the oldfalseonly ever meant "first in-app fetch failed", which is exactly the signal SDK-392 wants us to stop blocking on.3. Android is already on this contract.
RNIterableAPIModuleImpl.java#L139-L141:Android resolves
trueimmediately after syncIterableApi.initialize(...)and the comment explicitly acknowledges there are no error cases to surface. This PR brings iOS to that same contract.Net: nothing real is being silenced. If a downstream caller cares about the in-app fetch result (the only signal the old callback carried), it is still observable via
inAppManagerlisteners.