Skip to content

Stop repeated GitLab detail requests on mobile - #26197

Merged
nwparker merged 2 commits into
mainfrom
nwparker/perf-mobile-gitlab-detail-hydration
Oct 8, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/perf-mobile-gitlab-detail-hydration

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​277 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​277
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​249 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​232

ELI5

Opening a GitLab issue or merge request could keep fetching its details and clearing the sheet after every successful reply. Unchanged replies now leave the loaded sheet readable.

What Changed

Keep the selected item and list rows unchanged when the reply reports the same check counts, merge status, approval status, and reviewer count. Fields omitted by the host still preserve their existing values. Explicit refreshes and changed metadata continue to load details.

Why

The detail effect watches the selected item, but every GitLab reply replaced that item and triggered another request. Comparing the fields being hydrated stops that cycle while preserving the effect's existing refresh and stale-result behavior. A new cache or a narrower effect key would change when legitimate metadata updates refresh the sheet.

Linked Issue

N/A — found during the performance audit.

Visual Proof

The production mobile detail drawer and loading hook, rendered in a hidden Electron renderer with React Native Web at 430 × 900 and controlled valid replies. After the same four reply steps, the original has five requests and a spinner; the fix has two requests and stable loaded description/discussion. This checks the drawer behavior, not a phone or live GitLab connection.

Before After
GitLab details repeatedly loading GitLab description and discussion loaded

Testing

  • I manually tested these changes locally using the rendered drawer fixture
  • Automated tests added
  • The unchanged-reply regression failed before the fix: six completions started seven requests and left the sheet loading with no body. After the fix, initial hydration settles after two requests; an already hydrated item needs one.
  • 22 new hook tests cover all six check-summary fields, all three optional status fields, missing fields, unchanged references, explicit refresh, client/item replacement, close/unmount, refused/invalid replies, transport errors, and GitHub/Linear behavior. The affected seven-file suite passed 104 tests.
  • The full mobile suite also passed after reusing the existing fake RPC client: 937 test files and 10,131 tests; the raw-request boundary remains enforced.
  • Mobile production typecheck, test typecheck ratchet, ordinary lint, full-file static checks, changed-code quality, formatting, and the full mobile web build passed.
  • Verified on macOS with controlled transport replies through the production hook and checked reply readers. No live GitLab/SSH request or phone timing claim. Request parameters and wire format are unchanged.

Review

One production hook plus focused test fixtures. The type-only input contract preserves the caller's full model type and the exported downstream stage type.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • Small and focused
  • User-visible behavior, mechanism, and alternatives explained
  • Before/after screenshots attached
  • Self-reviewed for correctness and performance
  • Cross-platform and SSH/remote behavior considered
  • Relevant typechecks, tests, lint, and build pass

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e2f4b40c-0fa2-45b1-abdf-338f63e9a117
📥 Commits

Reviewing files that changed from the base of the PR and between 90634b1 and d61084b.

📒 Files selected for processing (1)
  • mobile/src/tasks/mobile-task-detail-hydration.test-fixture.tsx

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


📝 Walkthrough

Walkthrough

The hook compares fetched GitLab check and status fields with existing item data before updating the selected item or matching list entries. It preserves existing objects when those values are unchanged. New tests cover GitLab hydration, request lifetimes, failure responses, and GitHub and Linear detail reads. A shared fixture provides a controllable RPC client and mounted-hook controls.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to d6108

The supplied fixture review identifies no issue that needs to be resolved before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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. Analyzed 10 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: preventing repeated GitLab detail requests on mobile.
Description check ✅ Passed The description explains the problem, the change, the rationale, visual proof, and extensive testing. The Linked Issue section says N/A, although the template requests an issue link for outside contri…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

@nwparker
nwparker merged commit 602e7a3 into main Oct 8, 2026
21 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