feat: detect IBKR "Invalid username or password" credential-rejection modal - #18
Merged
Merged
Conversation
… modal handle_post_login_dialogs previously left the credential-rejection modal unhandled, so a wrong-credentials login fell through unrecognized at the initial-login stage. Add a _detect_bad_credentials() detector and a recognized branch that emits the existing ALERT_LOGIN_FAILED reason="bad-credentials" grep-contract token and dismisses the modal, then lets the normal CCP-backoff retry proceed — detection is a signal, not a corrective abort (no return False / sys.exit). The in-JVM relogin path recognizes the same wording too. Reuses the byte-identical suggested_action string (no monitor drift); updates OBSERVABILITY.md (two paths -> three) and CHANGELOG. Unit-tested (9 cases); not yet live-validated against a running Gateway. Gap spotted via @efJerryYang's fork; implemented independently.
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.
What
handle_post_login_dialogspreviously left IBKR's "Invalid username or password" credential-rejection modal unhandled — a wrong-credentials login fell through to the "unrecognized modal, leave in place" branch at the initial-login stage, so noALERT_LOGIN_FAILEDfired there.This adds:
_detect_bad_credentials()— a regex detector for the credential-rejection modal wording (including the two-word "user name" spelling some IBKR builds use), mirroring the existing_detect_password_expirystyle.handle_post_login_dialogsthat emits the existingALERT_LOGIN_FAILED reason="bad-credentials"grep-contract token, dismisses the modal, and lets the normal CCP-backoff retry proceed. Detection is a signal, not a corrective action — noreturn False/sys.exit, consistent with the documented Non-goal in CHANGELOG.attempt_inplace_relogin) recognizes the same wording too (purely additive).suggested_actionstring (no monitor/grep-contract drift);docs/OBSERVABILITY.mdupdated (two paths → three); CHANGELOG entry.Testing
_detect_bad_credentials(canonical modal + variants + negatives); full suite passes (246, up from 237).Credit
Gap spotted via @efJerryYang's fork. Implemented independently.