Skip to content

fix(mobile): fetch GitLab task details once per open - #37629

Merged
AmoabaKelvin merged 1 commit into
mainfrom
fetch-gitlab-task-details-once
Nov 3, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
fetch-gitlab-task-details-once

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​119 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​100
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​68 $\color{#cf222e}{\Huge{\mathbf{−}}}$​20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​48

ELI5

Opening a GitLab task on the phone now loads its details once. Refresh still fetches updated details and status.

What Changed

Item selection now distinguishes user actions from detail-response hydration. User actions still replace the request snapshot and cancel older reads; hydration updates the rendered item and task row without starting another request.

Why

The first GitLab response replaced actionItem, which was also an effect dependency and started a second request. Separating hydration at the selection owner removes that feedback while preserving same-item mutation invalidation through the existing detail effect.

Linked Issue

STA-13342

Visual Proof

N/A. The rendered details and status are unchanged; this removes a duplicate RPC request. Hook tests verify the loaded payload and selected/list status before and after refresh.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On macOS, the regression failed before the fix with two requests instead of one. The focused mobile hydration, lifecycle, and reply-schema suites pass, 50 tests across three files with ORCA_BACKGROUND_LAUNCH=1 and --maxWorkers=2. They cover refresh, status hydration, item/repository/type/project/client/provider switches, close/reopen, stale replies, failures, and same-item action updates during a pending read. Seventeen focused pilot/family RPC recordings and two recording mutation checks also pass without changing goldens.

Changed-file lint/format, code quality, React Doctor, and all 15 selected pnpm check:changed --base=origin/main --maxWorkers=2 gates pass. Full tests, typechecks, packaging, native devices, and Linux/Windows execution are left to CI under the shared-machine constraints.

Risk

Level: Low. Incorrect selection or hydration updates could leave a detail sheet stale after an action; lifecycle tests exercise those boundaries and the existing stale-response cleanup remains the request owner. No saved data, wire contracts, platform calls, host routing, or UI styling change. A plain revert restores the previous behavior.

AI Disclosure

Review

Exactly two review rounds on the diff from aaf4a5d9539 to the working tree committed as 86e88a5c6bc:

Round Codex Claude Outcome
1 No findings Same-item mutation could lose cancellation with key-only fetching, accepted as P1 Replaced that approach with the selection reducer and demonstrated the race regression failing before the repair
2 No findings No findings No accepted unresolved findings

Review covered local/remote client ownership, all four task providers, stale replies, refresh and selection lifetimes, performance, security, and test/mock fidelity. Test-audit retained behavioral coverage at the real hook boundary; the final hydration regression also fails if hydration is changed to invalidate the request. No UI or platform-specific code changed.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

The shared mobile loader still handles GitHub, GitLab, Jira, and Linear. Existing client routing covers local and remote repositories, with no OS, filesystem, shortcut, folder-workspace, agent, or mixed-version protocol changes. The request count drops from two to one after GitLab hydration.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The task selection state now tracks an action item and a separate detail-request item. The detail-loading hook uses the request item to load details and the hydration setter to update the action item. Tests cover request counts, refreshes, changed targets, provider switches, stale replies, and provider-specific hydrated values.

Merge Risk: Minimal · up to 86e88

Task hydration avoids duplicate reads, with no material merge risk established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing duplicate GitLab task-detail fetches when opening a task on mobile.
Description check Passed The description follows the required template and explains the user impact, mechanism, motivation, linked issue, testing, risk, rollback, platform scope, and checklist status. It also documents which …
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 follows the required template and explains the user impact, mechanism, motivation, linked issue, testing, risk, rollback, platform scope, and checklist status. It also documents which validation remains for CI.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 8 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/python/security/python-mysqlclient-hardcoded-secret-python.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: abd9abf1-3c3a-4d7e-b1d2-19d9cdb60d41
Commits

Reviewing files that changed from the base of the PR and between 35accd2 and 86e88a5.

Files selected for processing: 8
  • mobile/src/tasks/mobile-task-detail-hydration.test-fixture.tsx
  • mobile/src/tasks/use-mobile-tasks-item-detail-lifecycle.test.tsx
  • mobile/src/tasks/use-mobile-tasks-item-detail-loading.test.tsx
  • mobile/src/tasks/use-mobile-tasks-item-detail-loading.tsx
  • mobile/src/tasks/use-mobile-tasks-item-selection.ts
  • mobile/src/tasks/use-mobile-tasks-route-and-item-state.tsx
  • mobile/src/test-support/rpc-recording/adapters/task-item-detail-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/adapters/task-mount-adapters.ts

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

@AmoabaKelvin
AmoabaKelvin merged commit 0094f6e into main Nov 3, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant