fix: SDK stuck in bad state when calling login with restricted external IDs#2523
Open
jinliu9508 wants to merge 6 commits intomainfrom
Open
fix: SDK stuck in bad state when calling login with restricted external IDs#2523jinliu9508 wants to merge 6 commits intomainfrom
jinliu9508 wants to merge 6 commits intomainfrom
Conversation
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Threshold: 80% Changed Files Coverage
Overall Coverage (Changed Lines Only)1/2 changed lines covered (50.0%) ❌ Coverage Check FailedFiles below 80% threshold:
|
abdulraqeeb33
approved these changes
Jan 20, 2026
Contributor
abdulraqeeb33
left a comment
There was a problem hiding this comment.
looks fine to me. thank you for adding the unit tests
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Co-Authored-By: AR Abdul Azeez <abdul@onesignal.com>
58f1796 to
0c2afc5
Compare
Co-Authored-By: AR Abdul Azeez <abdul@onesignal.com>
Co-Authored-By: AR Abdul Azeez <abdul@onesignal.com>
Co-Authored-By: AR Abdul Azeez <abdul@onesignal.com>
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.
Description
One Line Summary
Treat restricted/invalid External ID login responses as non-retryable failures and does not need further handling so the SDK doesn’t pause the operation repo to get stuck in a bad state.
Details
Motivation
We reproduced an issue where calling OneSignal.login() with a restricted / blocked External ID can leave the SDK in a “bad” state where subsequent operations stop working until reinstall. The root cause is that the network response is being mapped to FAIL_PAUSE_OPREPO, which pauses the operation repository and effectively prevents recovery.
This PR changes the execution mapping so invalid (restricted) responses are treated as a non-retryable failure (FAIL_INVALID_LOGIN) that don't retry rather than pausing the op repo. This allows the SDK to continue functioning and lets the app recover (e.g., by retrying with a different External ID or after logout).
Scope
OPTIONAL - Other
We are basically hitting this loop:
Testing
Unit testing
Updated unit coverage to verify ResponseStatusType.INVALID maps to ExecutionResult.FAIL_INVALID_LOGIN (and does not return FAIL_PAUSE_OPREPO).
Manual testing
Tested on emulator Pixel 7 API 33
Step to reproduce:
After fix: Now able to call Logout or Login with another valid external ID.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is