fix(minimax-oauth): handle expired_in as Unix-ms timestamp, not seconds duration - #22023
Closed
algojogacor wants to merge 2 commits into
Closed
fix(minimax-oauth): handle expired_in as Unix-ms timestamp, not seconds duration#22023algojogacor wants to merge 2 commits into
algojogacor wants to merge 2 commits into
Conversation
…_images
document.images is unreliable on SPA and JavaScript-heavy pages,
causing 'SyntaxError: Unexpected end of input' when the eval bridge
processes expressions that rely on it.
Change to document.querySelectorAll('img') which returns a static
NodeList that Array.from can reliably convert. Also wrapped in an
IIFE to match the working workaround pattern from browser_console.
Fixes: #22012
Closes: #22012
MiniMax returns expired_in as a Unix-millisecond timestamp, not a seconds duration. This caused 'year 58382 is out of range' errors when the raw value was treated as seconds. Apply the same defensive heuristic already used by _minimax_poll_token at both OAuth login and refresh sites. Fixes: #22020
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.
Summary
MiniMax OAuth login fails with
year 58382 is out of rangebecause theexpired_infield is treated as a seconds-duration when MiniMax actually returns it as a Unix-millisecond timestamp.Root Cause
Both
_minimax_oauth_loginand_refresh_minimax_oauth_stateapplynow + expired_indirectly, treating the value as a seconds offset. When MiniMax returns a millisecond timestamp (~1.75e12), the resulting date is absurdly far in the future (>58000 CE).Fix
Applies the same defensive heuristic already used by
_minimax_poll_token(lines 4753-4762):expired_in > now_ms // 2→ treat as absolute Unix-ms timestamp, compute remaining secondsApplied at both sites:
_minimax_oauth_login(line 4876)_refresh_minimax_oauth_state(line 4952)Testing
The existing refresh test passes
expired_in: 7200(a duration), which hits the else branch and produces the sameexpires_in: 7200as before.Fixes: #22020