Skip to content

perf(linear): remove unused team lookups before metadata reads - #28708

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/perf-10-13-w9-cloud
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/perf-10-13-w9-cloud

Conversation

@nwparker

@nwparker nwparker commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​216 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​216
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​32 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28

ELI5

Before moving a Linear card, Orca fetched the whole team, discarded that response, then fetched its statuses. It now fetches the statuses directly, removing one sequential provider round trip before the card updates.

What Changed

UUID team metadata reads use the same generated Linear SDK relation queries without the unused parent-team lookup. A one-page status read goes from 2 provider requests to 1; a cold states/labels/members load goes from 6 to 3. Team keys keep the original lookup so pagination still uses their canonical IDs.

The existing page readers, projections, ordering, error handling and request limiter remain in place. The SDK stays lazily loaded.

Why

This removes external API work in ordinary board moves and cold issue-editor metadata loads, independently of team size. Reusing the SDK's existing queries keeps its models, pagination and error classes without introducing new GraphQL documents or changing cache freshness.

Merge risk: Low. Negative user-facing tradeoffs: NONE identified. Request counts were verified with the real SDK transport intercepted locally. Live-provider latency was not measured; this PR claims neither milliseconds saved nor a percentage UI speedup. The later status mutation is separate from these counts.

Performance qualification

Measurement Material gain Merge risk
One-page UUID status read: 2 → 1 provider requests; cold states/labels/members: 6 → 3 Removes sequential external trips in ordinary board moves and cold metadata loads; live latency unmeasured Low — existing SDK relation queries and page readers; result/error parity verified

Negative user-facing tradeoffs

NONE identified. Metadata, ordering, pagination, freshness and host ownership are preserved.

Linked Issue

Internal performance maintenance; no linked issue.

Visual Proof

N/A — this changes main-process provider reads; the returned metadata and rendered content are equivalent.

Testing

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

On macOS arm64, with ORCA_BACKGROUND_LAUNCH=1:

  • 51 tests passed across teams.test.ts, team-metadata-requests.test.ts and client.test.ts. The 24 new cases exercise the actual lazy SDK loader and HTTP transport: UUIDs, aliases, all three lists, continuation, projections, auth/token clearing, provider errors and permit release.
  • The new cold three-list regression fails against the original source: expected 3 requests, received 6. A separate ignored 30-case comparison verified before/after result and error parity.
  • Full node typecheck passed with workspace package paths rooted in this worktree; changed-code quality checks reported no new findings; the production main build and git diff --check passed.

No stored credentials or live provider calls were used. Measurement tooling is excluded from the diff. Linux, Windows and live SSH were not run; CI will cover the broader suite.

CI on this head is blocked by inherited main lint errors: the PR-generation file exceeds its line limit (from #28596), and a mobile Jira test uses two broad object parameters (from #28616). Exact failing-file blobs match the CI base; both narrow checks pass on the PR head. No unrelated repair is included.

Review

Independent review of the exact production and regression-test files found no blockers. Existing open #11060 changes assignee ordering and does not implement this request reduction.

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 same credential-owning host and selected Linear workspace execute the requests. Local/SSH/folder routing and RPC parameters/results retain their existing contracts. Cold metadata retains its existing cache; this is not a gain on every cached drawer opening.

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)
  • 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)
  • Full repository lint, typecheck, tests and build pass; focused local checks passed, CI will cover the full suite.

@coderabbitai

coderabbitai Bot commented Oct 14, 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: c3b0f62e-d882-4b07-80e3-6ef9dd01e9b5
📥 Commits

Reviewing files that changed from the base of the PR and between d194712 and 243bdc1.

📒 Files selected for processing: 3
  • src/main/linear/linear-sdk.ts
  • src/main/linear/team-metadata-requests.test.ts
  • src/main/linear/teams.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.

📝 Walkthrough

The SDK module now exposes team query constructors and parseLinearError. For UUID team IDs, readTeamResource uses direct paginated requests for states, labels, and members. Non-UUID team keys continue to use the SDK team lookup. Tests cover these request paths, pagination, error handling, and disconnected workspaces.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 243bd

No actionable merge-blocking issue is identified; the change is mergeable after normal checks.

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. Analyzed 4 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the main performance change: removing unused Linear team lookups before metadata reads.
Description check Passed The description follows the repository template and explains the user impact, mechanism, rationale, testing, limitations, review status, and checklist state. It also explains why no linked issue is in…
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • 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

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

@nwparker

Copy link
Copy Markdown
Contributor Author

Closing: the saved Linear round trip is on the fire-and-forget board-sync path (not user-visible), and only ~1 round trip on cold editor loads since the reads already run in parallel. It's unmeasured, and not enough gain for coupling to the SDK's generated query classes.

@nwparker nwparker closed this Oct 19, 2026
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