fix(gfn): implement serverInfo region fallback - #522
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b5960fea6
ℹ️ 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".
| if (primary) { | ||
| return primary; |
There was a problem hiding this comment.
Fall back after failed session responses
When the primary /v2/session request gets a non-OK response or CloudMatch API error, fetchActiveSessionsFromBase() returns [] rather than null. Since arrays are truthy, this branch returns immediately and never calls serverInfo, so the new region fallback only runs for thrown network errors; in provider/alliance cases where the generic base responds with 4xx/5xx but the local region has the active session, resume and force-new still see no sessions.
Useful? React with 👍 / 👎.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* Implement active-session fallback using serverInfo region discovery. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Fix active-session fallback on HTTP errors Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This PR implements a fallback mechanism for
getActiveSessionsto prevent failures when the primary CloudMatch region endpoint is unreachable.getActiveSessionsinsrc/main/gfn/cloudmatch.tsto queryv2/serverInfofor fallback region URLs (local-region,gfn-regions) if the primary fetch fails.extractServerInfoRegionBasesto parse and prioritize local region metadata fromserverInforesponse.discoverActiveSessionFallbackBasesandfetchActiveSessionsFromBaseto manage the retry logic and error handling.getActiveSessionsto include the stabledeviceIdin request headers.src/main/gfn/cloudmatch.test.tsfor region metadata extraction and the fallback fetch flow.