Skip to content

[SDK-289] Fixed double callback problem for setEmail with auto push registration#985

Merged
franco-zalamena-iterable merged 3 commits intomasterfrom
SDK-289-fix-double-callback-simple
Feb 4, 2026
Merged

[SDK-289] Fixed double callback problem for setEmail with auto push registration#985
franco-zalamena-iterable merged 3 commits intomasterfrom
SDK-289-fix-double-callback-simple

Conversation

@franco-zalamena-iterable
Copy link
Contributor

@franco-zalamena-iterable franco-zalamena-iterable commented Feb 3, 2026

🔹 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.

@franco-zalamena-iterable franco-zalamena-iterable force-pushed the SDK-289-fix-double-callback-simple branch from a70950b to 18cab40 Compare February 3, 2026 14:04
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some comments

Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@franco-zalamena-iterable franco-zalamena-iterable force-pushed the SDK-289-fix-double-callback-simple branch from e34e8b1 to 3121bb5 Compare February 4, 2026 09:53
@franco-zalamena-iterable franco-zalamena-iterable merged commit 08cef24 into master Feb 4, 2026
8 of 11 checks passed
@franco-zalamena-iterable franco-zalamena-iterable deleted the SDK-289-fix-double-callback-simple branch February 4, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants