Skip to content

fix(mobile): pull requests load from another environment when theirs is offline - #18698

Merged
juliusmarminge merged 1 commit into
mainfrom
fix/mobile-pr-environment-fallback
Oct 13, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
fix/mobile-pr-environment-fallback

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

When the environment a pull request was opened from goes offline, mobile kept showing that environment's cached copy and never sent a request. This happened even when another connected environment had the same repository with working GitHub auth. The GitHub routing setting didn't help, because it only reroutes requests that leave a connected environment.

Fix

  • Detail screen: while the pull request's environment isn't connected, the screen looks for another connected environment holding the same repository (matched by host plus owner/repo against the project's canonical repository key). If it finds one, it moves the route's environmentId/projectId there. The files, reviewers and review screens opened from it follow the new params.
  • List: when two environments list the same pull request, the de-dupe used to keep the first one in environment-id order, which could be an offline environment's cached row. It now prefers a connected environment's row. Order is unchanged while both are connected.

Limits

  • The fallback needs another environment with a checkout of the repository. Without one, the cached data still shows, marked Offline.
  • The route doesn't switch back when the original environment reconnects.
  • Review drafts are keyed by environment, so a draft started against the offline copy doesn't carry over.

Verification

  • vp test run src/features/pull-requests/pullRequestEnvironmentFallback.test.ts src/features/pull-requests/pullRequestList.test.ts passes.
  • Mobile tsc-rs --noEmit passes.
  • Not yet tried on a device or simulator.

Done with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code


Devin Review

…is offline

A pull request opened from an environment that is now offline stayed on its
cached copy, even when another connected environment holds the same repository.
The detail screen now moves to a connected copy of the repository, and the list
prefers a connected environment's row over an offline one's for a shared PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 12, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 12, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Oct 12, 2026
(project) =>
project.environmentId !== target.environmentId &&
connectedEnvironmentIds.has(project.environmentId) &&
project.repositoryIdentity?.canonicalKey.toLowerCase() === key,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High pull-requests/pullRequestEnvironmentFallback.ts:30

A connected Forgejo checkout on a non-default HTTP port is never selected, so the pull request detail screen stays offline despite an available copy. The route host forge.example:3000 is compared directly with the canonical key forge.example/team/repo, which omits the port; match using the project's provider-aware host and repository instead.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/mobile/src/features/pull-requests/pullRequestEnvironmentFallback.ts around line 30:

A connected Forgejo checkout on a non-default HTTP port is never selected, so the pull request detail screen stays offline despite an available copy. The route host `forge.example:3000` is compared directly with the canonical key `forge.example/team/repo`, which omits the port; match using the project's provider-aware host and repository instead.

@macroscopeapp

macroscopeapp Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — This is a localized mobile bug fix with focused runtime changes and targeted tests for selecting connected pull-request data. A concrete high-severity finding remains around Forgejo repositories using non-default HTTP ports, which independently blocks clean approval until addressed.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB +24 B (+0.5%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB +24 B (+2.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB +41 B (+0.2%) 29.3 KiB ✅
Claude Live turn messages 1 2 +1 (+100.0%) 8 ✅

Baseline: 701fc83 · PR result: bdbdd70 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 2c4cfc12-7569-41b4-8582-b51ba5eba8cd

📥 Commits

Reviewing files that changed from the base of the PR and between 701fc83 and bdbdd70.


📒 Files selected for processing (7)
  • apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
  • apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx
  • apps/mobile/src/features/pull-requests/pullRequestEnvironmentFallback.test.ts
  • apps/mobile/src/features/pull-requests/pullRequestEnvironmentFallback.ts
  • apps/mobile/src/features/pull-requests/pullRequestList.test.ts
  • apps/mobile/src/features/pull-requests/pullRequestList.ts
  • 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.



📝 Walkthrough

Walkthrough

Pull-request routes can switch to a connected project with the same repository identity. The pull-request list can prefer a connected environment when duplicate entries share a repository.

Changes

Pull request environment selection

Layer / File(s) Summary
Route environment fallback
apps/mobile/src/features/pull-requests/pullRequestEnvironmentFallback.ts, apps/mobile/src/features/pull-requests/usePullRequestEnvironmentFallback.ts, apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx, apps/mobile/src/features/pull-requests/pullRequestEnvironmentFallback.test.ts
The route checks for a connected project with a matching repository identity and updates its navigation parameters when a fallback is found. Tests cover matching projects, connected targets, and host derivation.
Connected pull-request list entries
apps/mobile/src/features/pull-requests/pullRequestList.ts, apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx, apps/mobile/src/features/pull-requests/pullRequestList.test.ts
The list filter accepts connected environment IDs and prefers a connected entry among duplicate pull requests. The screen recomputes entries when connected targets change. Tests cover connected and disconnected duplicates.

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant PullRequestRouteScreen
  participant usePullRequestEnvironmentFallback
  participant pullRequestFallbackEnvironment
  participant Navigation
  PullRequestRouteScreen->>usePullRequestEnvironmentFallback: pass route parameters
  usePullRequestEnvironmentFallback->>pullRequestFallbackEnvironment: pass target, projects, and connected environment IDs
  pullRequestFallbackEnvironment-->>usePullRequestEnvironmentFallback: return fallback or null
  usePullRequestEnvironmentFallback->>Navigation: set fallback route parameters
Loading

Merge Risk: ⚪ Minimal · up to bdbdd

No confirmed issue prevents merging. Hostless deep links on a cold start remain worth checking on a device.

Pre-merge checks | Passed 3 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check Warning The description explains the problem, implementation, limitations, and verification results. It does not include the required Scope and approval section or explain why the focused fix qualifies withou… Add a Scope and approval section. Link the triaged issue or maintainer approval, including the approval comment. If no prior issue or approval exists, explain why this focused fix addresses an obvious bug and qualifies for the exception.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main mobile pull-request fallback behavior when the original environment is offline.
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: Description check

Explanation

The description explains the problem, implementation, limitations, and verification results. It does not include the required Scope and approval section or explain why the focused fix qualifies without prior issue or maintainer approval.


  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge merged commit 5070a83 into main Oct 13, 2026
33 of 34 checks passed
@juliusmarminge
juliusmarminge deleted the fix/mobile-pr-environment-fallback branch October 13, 2026 03:54
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 13, 2026
## What's Changed
* fix(server): apply confirmed Claude subagent outcomes by @Yash-Singh1 in pingdotgg/t3code#18778
* fix(mobile): Browser page no longer logs a duplicate key warning by @tris203 in pingdotgg/t3code#18776
* fix(web): a numeric q in the pull requests URL no longer crashes the page by @ScottN-PV in pingdotgg/t3code#18666
* fix(client): T3 Connect clients reconnect once a new tunnel is ready by @shivamhwp in pingdotgg/t3code#16554
* fix(web): leaving the home page while the app loads no longer bounces you to a new draft by @shivamhwp in pingdotgg/t3code#18672
* fix(mobile): attachment images no longer re-download on every reconnect by @shivamhwp in pingdotgg/t3code#18824
* fix(server): a migration id clash stops startup with a clear error instead of crash-looping by @shivamhwp in pingdotgg/t3code#15925
* fix(server): a thread with an event type from a newer build can still resync after a downgrade by @shivamhwp in pingdotgg/t3code#15937
* fix(server): Codex titles and branch names no longer start the user's MCP servers by @brycedbjork in pingdotgg/t3code#17058
* fix(server): Claude thinking before a tool call stays a collapsed Thought by @maria-rcks in pingdotgg/t3code#18887
* perf(server): cached branch PR lookups no longer start git processes by @SunkenInTime in pingdotgg/t3code#17063
* fix(web): compact merge buttons show when they need a second click by @TonybynMp4 in pingdotgg/t3code#18878
* fix(mobile): pull requests load from another environment when theirs is offline by @juliusmarminge in pingdotgg/t3code#18698
* perf(web): collect active tool calls without array shifts by @saphid in pingdotgg/t3code#18853
* fix(web): center the pace icon on the limit card's "left" label by @akash3444 in pingdotgg/t3code#18580
* fix(web): update everything includes npm-installed servers again by @ScottN-PV in pingdotgg/t3code#18709
* fix(server): review guides find Bitbucket heads reported by short hash by @ahilles107 in pingdotgg/t3code#18900
* fix(web): scheduled task model picker no longer shifts the dialog by @flamboh in pingdotgg/t3code#18940
* fix(ci): CodeRabbit reviews no longer request changes by @Yash-Singh1 in pingdotgg/t3code#18954

## New Contributors
* @brycedbjork made their first contribution in pingdotgg/t3code#17058

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261013.3042...v0.0.46-nightly.20261013.3053

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261013.3053
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 13, 2026
## What's Changed
* fix(server): apply confirmed Claude subagent outcomes by @Yash-Singh1 in pingdotgg/t3code#18778
* fix(mobile): Browser page no longer logs a duplicate key warning by @tris203 in pingdotgg/t3code#18776
* fix(web): a numeric q in the pull requests URL no longer crashes the page by @ScottN-PV in pingdotgg/t3code#18666
* fix(client): T3 Connect clients reconnect once a new tunnel is ready by @shivamhwp in pingdotgg/t3code#16554
* fix(web): leaving the home page while the app loads no longer bounces you to a new draft by @shivamhwp in pingdotgg/t3code#18672
* fix(mobile): attachment images no longer re-download on every reconnect by @shivamhwp in pingdotgg/t3code#18824
* fix(server): a migration id clash stops startup with a clear error instead of crash-looping by @shivamhwp in pingdotgg/t3code#15925
* fix(server): a thread with an event type from a newer build can still resync after a downgrade by @shivamhwp in pingdotgg/t3code#15937
* fix(server): Codex titles and branch names no longer start the user's MCP servers by @brycedbjork in pingdotgg/t3code#17058
* fix(server): Claude thinking before a tool call stays a collapsed Thought by @maria-rcks in pingdotgg/t3code#18887
* perf(server): cached branch PR lookups no longer start git processes by @SunkenInTime in pingdotgg/t3code#17063
* fix(web): compact merge buttons show when they need a second click by @TonybynMp4 in pingdotgg/t3code#18878
* fix(mobile): pull requests load from another environment when theirs is offline by @juliusmarminge in pingdotgg/t3code#18698
* perf(web): collect active tool calls without array shifts by @saphid in pingdotgg/t3code#18853
* fix(web): center the pace icon on the limit card's "left" label by @akash3444 in pingdotgg/t3code#18580
* fix(web): update everything includes npm-installed servers again by @ScottN-PV in pingdotgg/t3code#18709
* fix(server): review guides find Bitbucket heads reported by short hash by @ahilles107 in pingdotgg/t3code#18900
* fix(web): scheduled task model picker no longer shifts the dialog by @flamboh in pingdotgg/t3code#18940
* fix(ci): CodeRabbit reviews no longer request changes by @Yash-Singh1 in pingdotgg/t3code#18954

## New Contributors
* @brycedbjork made their first contribution in pingdotgg/t3code#17058

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261013.3042...v0.0.46-nightly.20261013.3053

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261013.3053
adampeterhiggins added a commit to adampeterhiggins/t3code that referenced this pull request Oct 13, 2026
* fix(gitlab): merge request details report their head commit (pingdotgg#18608)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(server): rename built-in models from settings (pingdotgg#18840)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): Git actions follow the selected thread (pingdotgg#18862)

* fix(desktop): preserve updater failure causes in diagnostics (pingdotgg#18864)

* fix(web): attach dropped threads to pending answers (pingdotgg#18789)

* fix(web): keep button text stable during press scaling (pingdotgg#18866)

* fix(bitbucket): preserve PR head commits for review guides (pingdotgg#18402)

* fix(server): return null for unresolved optional commands (pingdotgg#18871)

* fix: show computer-use action titles and align app icons (pingdotgg#18865)

* fix(server): apply confirmed Claude subagent outcomes (pingdotgg#18778)

* fix(mobile): Browser page no longer logs a duplicate key warning (pingdotgg#18776)

* fix(web): a numeric q in the pull requests URL no longer crashes the page (pingdotgg#18666)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(client): T3 Connect clients reconnect once a new tunnel is ready (pingdotgg#16554)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(web): leaving the home page while the app loads no longer bounces you to a new draft (pingdotgg#18672)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(mobile): attachment images no longer re-download on every reconnect (pingdotgg#18824)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): a migration id clash stops startup with a clear error instead of crash-looping (pingdotgg#15925)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test>

* fix(server): a thread with an event type from a newer build can still resync after a downgrade (pingdotgg#15937)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test>

* fix(server): Codex titles and branch names no longer start the user's MCP servers (pingdotgg#17058)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>

* fix(server): Claude thinking before a tool call stays a collapsed Thought (pingdotgg#18887)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

* perf(server): cached branch PR lookups no longer start git processes (pingdotgg#17063)

* fix(web): compact merge buttons show when they need a second click (pingdotgg#18878)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(mobile): pull requests load from another environment when theirs is offline (pingdotgg#18698)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* perf(web): collect active tool calls without array shifts (pingdotgg#18853)

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>

* fix(web): center the pace icon on the limit card's "left" label (pingdotgg#18580)

* fix(web): update everything includes npm-installed servers again (pingdotgg#18709)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): review guides find Bitbucket heads reported by short hash (pingdotgg#18900)

Co-authored-by: Pawel Mikolajczuk <pmikolajczuk@atlassian.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): scheduled task model picker no longer shifts the dialog (pingdotgg#18940)

* fix(ci): CodeRabbit reviews no longer request changes (pingdotgg#18954)

---------

Co-authored-by: Scott Norteman <snorteman@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
Co-authored-by: Paweł Mikołajczuk <pawel@mikolajczuk.in>
Co-authored-by: Tristan Knight <admin@snappeh.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Bryce Bjork <brycedbjork@gmail.com>
Co-authored-by: maria <maria@kuuro.net>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: Dara Adedeji <76637177+SunkenInTime@users.noreply.github.com>
Co-authored-by: Antony <97451137+TonybynMp4@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Alex Southwell <saphid@gmail.com>
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Akash Moradiya <64416825+akash3444@users.noreply.github.com>
Co-authored-by: Pawel Mikolajczuk <pmikolajczuk@atlassian.com>
Co-authored-by: oliver <97427849+flamboh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant