Avoid false signed-out detection on MiniMax coding-plan shell pages#508
Avoid false signed-out detection on MiniMax coding-plan shell pages#508qipihen wants to merge 1 commit intosteipete:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4448d5e4ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| private static func looksSignedOut(html: String) -> Bool { | ||
| let lower = html.lowercased() | ||
| let lower = self.visibleText(from: html).lowercased() |
There was a problem hiding this comment.
Preserve script-only login detection for signed-out shells
Switching looksSignedOut to only scan visibleText drops all <script> content, so a JS-rendered sign-in shell with no visible login copy now returns false here even when auth has expired. In that case fetchCodingPlanHTML/fetchCodingPlanRemains continue into parse(html:), which can surface parseFailed (or partial script-derived data) instead of invalidCredentials, changing user-facing behavior for expired cookies. Consider keeping a fallback raw-HTML login signal when extracted visible text is empty.
Useful? React with 👍 / 👎.
|
Thanks for PR @qipihen ! Small concern: since looksSignedOut now scans only visibleText, a real JS login shell with no visible copy might slip through and become parseFailed instead of invalidCredentials. Maybe keep a raw-HTML fallback when visible text is empty? |
Summary
sign in/log in/登录/登入__NEXT_DATA__shell page to the remains APIScope
This PR does not add MiniMax support as a new provider.
It fixes the MiniMax web-fetch path that already exists in the current upstream codebase.
Why
MiniMax's current Coding Plan page can return an SSR shell where login-related translation strings live inside
__NEXT_DATA__, even though the page is not actually the sign-in screen. The previous raw-string check saw登录in the script payload and returnedinvalidCredentialsbefore the fetcher could fall back tocoding_plan/remains.Validation
MiniMax credentials are invalid or expiredswift test --disable-experimental-prebuilts --filter MiniMaxon a clean local checkout; that run is currently blocked here by an unrelatedKeyboardShortcuts#Previewmacro build issue, not by this diff