Skip to content

Bugfix/no push reregister on token refresh#1003

Open
franco-zalamena-iterable wants to merge 10 commits intoautoretry-masterfrom
bugfix/no-push-reregister-on-token-refresh
Open

Bugfix/no push reregister on token refresh#1003
franco-zalamena-iterable wants to merge 10 commits intoautoretry-masterfrom
bugfix/no-push-reregister-on-token-refresh

Conversation

@franco-zalamena-iterable
Copy link
Contributor

@franco-zalamena-iterable franco-zalamena-iterable commented Mar 13, 2026

✏️ Description

Fixed a problem with completeuserlogin retrigger

Decoupling the completeUserLogin from the SetAuthToken flow. Those live independently now

“Akshay and others added 5 commits March 10, 2026 10:37
Includes
1. getRemoteConfiguration checking for the flag. And assuming false if no values exist. Also stores in sharedPreferences to load from it next time.
2. isAutoRetryOnJWTFailure on `IterableAPI` which other classes with use. Not public.
3. Introduced three states which Taskmanager can rely on. VALID, INVALID, UNKNOWN.
4. Listener pub/sub added which will invoke onAuthTokenReady() on listner class. Adding array of AuthTokenReadyListener on Authmanager and its add and remove list methods.
5. Right now authHandler null returns true hoping to bypass jwt. But JWT based request will fail if API needs jwt. This could pile up storage. But this seems like a valid scenario
6. handleAuthTokenSucess sets authtoken to unknown when a new token is set. I hope it should be right approach. Because its new and unknown at this point.
7. `IterableConfig` has final boolean `autoRetryOnJwtFailure`. Its not something I want customers to be able to configure. It should be removed before going to master. It should be internal only variable.
8. IterableRequestTask - has some changes introduced due to the flow not falling under jwt failure. Response code coming has -1 was the root cause. Hence the change around responseCode >= 0 && responseCode < 400
9. `IterableRequestTask` - Line 215 - Still not sure if RequestProcessor check should happen. It does make sense to have it as only offline stored request will be reprocessed. And this feature should only work for those requests going through offline Request processor
10. `IterableRequestTask` - fromJSON method change is something I havent checked properly. I think its for unit testing the changes are done.
11. IterableTaskRunner. Would like to see if I can remove the method - isJWTFailure(responseCode). May be its a small abstraction thats needed.
12. Havent checked unit tests properly yet
@franco-zalamena-iterable franco-zalamena-iterable force-pushed the bugfix/no-push-reregister-on-token-refresh branch from 68f10bc to 6bc8f7b Compare March 13, 2026 14:29
Aligns offline task retry logic with iOS PR 1012: use HTTP status codes
instead of fragile string matching to classify errors. 4xx (except 401
JWT and 429 rate-limit) are permanent failures (task deleted). 5xx,
network errors, and timeouts are transient (task retained for retry).

Also fixes two tests that were missing mock server responses, which
now correctly matter since network errors are treated as transient.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Now we are recreating the token and starting the auto retry
@franco-zalamena-iterable franco-zalamena-iterable force-pushed the bugfix/no-push-reregister-on-token-refresh branch from db3f49f to bc065e5 Compare March 17, 2026 10:40
@franco-zalamena-iterable
Copy link
Contributor Author

Wait for bugbash to be completed

Base automatically changed from feature/auto-retry to autoretry-master March 19, 2026 10:43
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.

1 participant