-
Notifications
You must be signed in to change notification settings - Fork 376
fix: SDK stuck in bad state when calling login with restricted external IDs #2523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📊 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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine to me. thank you for adding the unit tests
nan-li
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp block
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>
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