Skip to content

fix(mobile): let slow Automation catalog reads finish - #37669

Merged
brennanb2025 merged 5 commits into
mainfrom
brennanb2025/linear-mobile-automation-catalog
Nov 3, 2026
Merged

brennanb2025 merged 5 commits into
mainfrom
brennanb2025/linear-mobile-automation-catalog

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Phone Automations could stay on Loading forever when a successful list or status request took more than 15 seconds. Each polling tick replaced the pending read before its reply arrived, even though the shared timeout is 30 seconds. The regression began in #31617; tracked in STA-13320.

Let the pending list/status pair finish. Polls skip it, while events and explicit refreshes coalesce into one following read. Explicit refresh still waits for fresh results, accepted actions retire older read authority before changing rows, and newer action warnings survive older refreshes. Cancellation applies only to catalog reads; actions and uncertain create outcomes retain their existing behavior.

Intended existing behavior: page cancellation releases its local waiter, while the uncancellable host request retains its physical slot until normal settlement. The shared timeout, protocol, saved data, and UI are unchanged.

Validation: the slow 20-second pair and 29-second status cases fail on unpatched main and pass with this change. Focused production-hook and request-boundary coverage passes 76 tests, including silent connection-generation replacement, existing create reconciliation, and bridge cancellation contracts. Independent correctness, architecture, and repair review passed; final CI is green; this is the full review path for ordering/lifecycle work. Mobile QA is the tests row for this invisible scheduling change; no app or agent run is required for this cut.

@brennanb2025
brennanb2025 marked this pull request as ready for review November 3, 2026 05:15
@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

useAutomationCatalog coalesces refreshes and coordinates catalog and host-status requests through scoped batches. It aborts and settles pending reads when a scope retires, and applies results only while the scope remains current. Connection changes, cleanup, and current action outcomes retire reads. Action warnings use a shared setter with authority checks. Tests cover batching, failures, recovery, stale responses, lifecycle changes, and periodic refreshes.

Merge Risk: Minimal · up to 9338d

The added tests cover slow catalog reads and stale responses. No issue identified here needs resolution before merge; normal checks remain pending.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

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.
Description check Warning The description clearly explains the problem, implementation, expected behavior, and validation. However, it does not follow the required template: it omits the required section headings, lacks an act… Rewrite the description using the repository template. Add all required headings, link the actual STA-13320 issue, state N/A with a reason under Visual Proof, document the risk level and rollback plan, provide testing platforms and comman…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: allowing slow Automation catalog reads to finish.
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: 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 5 functions across 2 files.

Resolution

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

Full details: Description check

Explanation

The description clearly explains the problem, implementation, expected behavior, and validation. However, it does not follow the required template: it omits the required section headings, lacks an actual linked issue URL, does not state Visual Proof as N/A, and does not provide the required risk level, checklist confirmations, cross-platform considerations, or AI disclosure status.

Resolution

Rewrite the description using the repository template. Add all required headings, link the actual STA-13320 issue, state N/A with a reason under Visual Proof, document the risk level and rollback plan, provide testing platforms and commands, address the checklist items, and complete or explicitly mark the AI Disclosure and Agent skill sections as applicable.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · 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

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: f9c205a4-438c-4015-94df-d2b0ffa98cda
Commits

Reviewing files that changed from the base of the PR and between d85c043 and 9338d11.

Files selected for processing: 1
  • mobile/src/automations/use-automation-catalog.test.tsx
Files skipped from review as they are similar to previous changes: 1
  • mobile/src/automations/use-automation-catalog.test.tsx

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Phone Automations could remain on Loading when a successful list/status pair took more than 15 seconds: the next poll discarded its publication authority before the replies arrived. This PR lets that pair finish, skips periodic ticks while pending, and coalesces events or explicit refreshes into one following read. The existing 30-second timeout is unchanged.

Accepted actions retire older catalog reads before updating rows, and an older refresh cannot clear a newer action warning. Explicit refreshes finish on read settlement or owner retirement, including silent connection-generation replacement. Cancellation remains limited to catalog reads; user writes and uncertain create outcomes keep their existing behavior. Page cancellation still releases the local waiter while an uncancellable host request retains its physical slot until normal settlement.

Independent correctness and architecture review passed; the required separate continued reviewer and original reviewer verified the one lifetime-cleanup repair. A later test-only repair made the timer callbacks typecheck without changing their timing or assertions. No findings are deferred. Slow 20-second and 29-second schedules fail on unpatched main. All 76 focused production-hook/request-boundary tests pass, covering explicit/event coalescing, action/warning ordering, sibling cleanup, replacement lifetimes, existing positive create reconciliation and bridge signal behavior. No app, emulator, screenshot, or agent execution was required or performed for this invisible mobile tests-row change.

Final CI is green on 9338d110660d8ba53ce48e443ee58c16374148d4: Mobile verify, static analysis and typecheck, mobile web bundle, and the aggregate PR gate passed. Required check:changed passed all 41 checks immediately before the final push. The one main merge d85c0437 preserved the reviewed mobile tree byte for byte; the subsequent 9338d110 changes only test callback typing and passed the exact mobile test-typecheck ratchet plus all 12 catalog tests. Continued review verified both deltas; behavioral evidence remains on 48ba3eab.

For Brennan’s review: read admission and publication, retired intent settlement, and silent-generation regression.

@brennanb2025
brennanb2025 merged commit d3034a7 into main Nov 3, 2026
26 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