[SDK-369] no push reregister on token refresh#1003
Open
franco-zalamena-iterable wants to merge 11 commits intomasterfrom
Open
[SDK-369] no push reregister on token refresh#1003franco-zalamena-iterable wants to merge 11 commits intomasterfrom
franco-zalamena-iterable wants to merge 11 commits intomasterfrom
Conversation
68f10bc to
6bc8f7b
Compare
db3f49f to
bc065e5
Compare
Contributor
Author
|
Wait for bugbash to be completed |
Now we are recreating the token and starting the auto retry
bc065e5 to
6d3a0b7
Compare
iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java
Dismissed
Show dismissed
Hide dismissed
joaodordio
reviewed
Apr 8, 2026
iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableAuthManager.java
Outdated
Show resolved
Hide resolved
…ceiving a valid JWT when in the invalid state
…k to valid, fire getMessages, syncEmbedded and registerDeviceToken
The deprecated setAuthToken() was unconditionally calling completeUserLogin() via storeAuthData(). On master, it only triggered login when the token actually changed. Restore that guard to prevent unnecessary login cycles when callers pass the same token. Made-with: Cursor
sumeruchat
requested changes
Apr 13, 2026
Contributor
sumeruchat
left a comment
There was a problem hiding this comment.
AI Review
- Behavior change for setEmail(sameEmail) is a compat break. Apps that were calling it repeatedly as an idempotent no-op will now see extra syncs and backend
calls. I don't think it's in the CHANGELOG — worth mentioning there since it's an observable runtime change. - Deprecation warning log fires on every setAuthToken call. For apps that haven't migrated, that's potentially thousands of log lines per session. Consider
IterableLogger.w once-per-session (static AtomicBoolean). - updateAuthToken(null) silently stores null with no validation. Previously the old setAuthToken(null, true) path went through completeUserLogin which
rejected null under JWT. This is fine given the split, but means updateAuthToken is a footgun — a caller on the public API could clear the token in a state
where the SDK then makes unauthenticated requests. Maybe worth a @nonnull or at least no-op on null. - Bugbash gate: since Franco asked to wait for bugbash, probably worth approving conditionally or holding review approval until QA signs off — especially
given #1 is a behavioral change.
My review
This look a little bit dangerous to me as its behavior change and since no one is asking for this do we need to do this? @franco-zalamena-iterable Basically i see only potential risks of breaking existing behaviour with no upside.
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
Fixed a problem with completeuserlogin retrigger
Decoupling the completeUserLogin from the SetAuthToken flow. Those live independently now.
Summary
setAuthToken replaced with updateAuthToken. This only handles the update of the auth token without the side effects of login. If the user expects a login flow, the setEmail should be called. This prevents unnecessary calls to the backend on token refreshes