Skip to content

fix(mobile): fail over pull requests after a host timeout - #40939

Open
rafiki270 wants to merge 1 commit into
pingdotgg:mainfrom
rafiki270:fix/mobile-pr-fallback-after-timeout
Open

rafiki270 wants to merge 1 commit into
pingdotgg:mainfrom
rafiki270:fix/mobile-pr-fallback-after-timeout

Conversation

@rafiki270

Copy link
Copy Markdown

A relay 504 leaves the mobile pull request screen waiting for its original environment even when another connected environment has the same repository.

Let the existing repository fallback run after a connection timeout. Keep the original environment during initial connection and while device approval is pending.

Verification

  • iPhone 17 simulator on iOS 26.5. With two paired environments sharing the same repository, I stopped the original endpoint from answering. On base 344de5fe8e, PR fix(mobile): attaching a photo on Android no longer fails while the + menu closes #40825 showed the timeout. With the patch, the same screen loaded its description, checks, reviews, and file list while the original endpoint still timed out.
  • The regression tests cover a relay HTTP 504, a direct timeout, and pending device approval. All 9 fallback tests passed with both iOS and Android compilation.
  • vp run check:changed and vp check passed. The mobile suite passed 3,734 tests and the scripts suite passed 296 tests with 20 skips.
Before After
Pull request overview shows offline timeout The same overview loads from the connected environment

Built with Codex (GPT-6.2 Sol) in T3 Code.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T16:53:49.141344Z 8557bfe PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request environment fallback now considers the requested environment’s last connection failure. Timeout and HTTP 504 failures trigger fallback to a connected repository copy while reconnecting. Approval-pending failures retain the requested environment.

Changes: Pull request environment fallback

Layer / File(s) Summary
Pass connection failures into fallback selection
apps/mobile/src/features/pull-requests/pullRequestEnvironmentFallback.ts, apps/mobile/src/features/pull-requests/usePullRequestEnvironmentFallback.ts
The hook passes the requested environment’s last connection failure to the fallback function. While reconnecting, the function retains the requested environment unless the failure is a timeout or has HTTP status 504.
Test timeout and pending-approval outcomes
apps/mobile/src/features/pull-requests/usePullRequestEnvironmentFallback.test.tsx
Tests provide connection catalog state and check fallback behavior for timeout, HTTP 504, and approval-pending failures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#24262: Changes the conditions for retaining a requested pull request environment or falling back to another connected repository copy.

Suggested reviewers: juliusmarminge, macroscopeapp

Merge Risk: Minimal · up to 8557b

Pull requests should now load from another connected environment after a host timeout or HTTP 504, while initial connection and pending device approval still keep the original environment. I found no concrete defect in the change, and it is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(mobile): fail over pull requests after a host timeout" matches the main change. The raw summary and PR objectives both describe a fallback to another connected environment after a relay…
Description check Passed The description covers the problem, the change, and verification, and it follows the template's intent. It states the problem (a relay 504 leaves the screen waiting on the original environment) and th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(mobile): fail over pull requests after a host timeout" matches the main change. The raw summary and PR objectives both describe a fallback to another connected environment after a relay 504 or direct timeout, so the title is specific and on topic. It uses a conventional commit prefix and avoids vague wording. The PR objectives cite PR number #40939 while the description shows the same title, so no conflict affects the verdict.

Full details: Description check

Explanation

The description covers the problem, the change, and verification, and it follows the template's intent. It states the problem (a relay 504 leaves the screen waiting on the original environment) and the change (run the repository fallback after a connection timeout while keeping the original environment during initial connection and pending approval). Verification is detailed, with a simulator run, named regression tests, and before/after screenshots. The Scope section is missing: the description does not link an issue that shows the bug, does not explain why no issue is needed, and does not say whether a maintainer requested the PR. The template's agent attribution line is present ("Built with Codex (GPT-6.2 Sol) in T3 Code."). The PR is mostly complete, so the check passes, but the author should add the Scope information.

Resolution

Add a Scope section. Link the issue that shows the bug, or explain why a small obvious fix needs no issue. Link any maintainer request for the PR. Keep the section headings from the template.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9de4ec1 and 8557bfe.

Files selected for processing: 3

  • apps/mobile/src/features/pull-requests/pullRequestEnvironmentFallback.ts
  • apps/mobile/src/features/pull-requests/usePullRequestEnvironmentFallback.test.tsx
  • apps/mobile/src/features/pull-requests/usePullRequestEnvironmentFallback.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant