Repository navigation
Stop repeated GitLab detail requests on mobile - #26197
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe 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 The supplied fixture review identifies no issue that needs to be resolved before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
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.
Testing
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
Checklist