[SDK-289] Fixed double callback problem for setEmail with auto push registration#985
Merged
franco-zalamena-iterable merged 3 commits intomasterfrom Feb 4, 2026
Merged
Conversation
a70950b to
18cab40
Compare
Ayyanchira
reviewed
Feb 3, 2026
iterableapi/src/main/java/com/iterable/iterableapi/IterableInAppManager.java
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableHelper.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableHelper.java
Outdated
Show resolved
Hide resolved
… and with better messages
e34e8b1 to
3121bb5
Compare
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
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.
🔹 Jira Ticket(s) if any
✏️ Description
This fix is meant to be a more straight forward fix for the double callback issue some clients have encountered when autoPushRegistration is set to false.
Root cause:
When autoPushRegistration is false and we call setEmail, no remote call is made to actually update the current user in the iterable app, so we wait for the push registration to be made to consider it completely done.
Because some users were using the callbackHandler within a couroutine, when the registerDeviceToken was called we would wrap the setEmail callback into the registerDeviceToken call, so we could notify when the setEmail flow was actually completed, but that caused the callback to fire twice, and if the coroutine was dependant of a success to continue that would cause the app to crash.
The Solution:
To clear the success handler when it is called on autoPushRegistration = false, so when the user calls for registering the device we won't cause the same success handler to fire twice.
Also some better responses are provided for better understanding of the process and why things are happening this way.