fix: SDK stuck in bad state when calling login with restricted external IDs #2523
+30
−1
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 so the SDK doesn’t pause the operation repo and 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_NORETRY) 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
This aligns the behavior with expected semantics:
Avoids requiring uninstall/reinstall to recover after a restricted External ID attempt.
Testing
Unit testing
Updated unit coverage to verify ResponseStatusType.INVALID maps to ExecutionResult.FAIL_NORETRY (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