Skip to content

fix(linear): prevent unrelated team outages from aborting batch push - #31

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-7d47
Draft

fix(linear): prevent unrelated team outages from aborting batch push#31
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-7d47

Conversation

@cursor

@cursor cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Fixes a high-impact batch sync regression in Linear multi-team mode.

Tracker.BatchPush was eagerly building state caches for all configured teams before doing any work. If any secondary team had an outage or permission failure, the function returned an error and Engine.doPush aborted the entire push.

Bug and impact

  • Impact: significant user-facing breakage in multi-team setups.
  • Concrete trigger: configure teams A,B; B state lookup fails (transient 5xx/auth issue); run push containing only new issues for primary team A.
  • Observed behavior before fix: BatchPush returned building state cache for team B: ...; Engine.doPush aborted all syncing, including healthy team A creates.

Root cause

BatchPush preloaded state caches for every teamID unconditionally at function start, widening the failure domain to unrelated teams.

Fix

  • Load team state caches lazily via resolveTeamCache(teamID).
  • Build primary cache only when create path is actually used.
  • For update path, resolve only the routed team cache and record per-issue errors on failure rather than aborting the entire batch.

Tests

Added regression test:

  • TestBatchPush_DoesNotFailCreateWhenSecondaryTeamStateCacheFails
    • Validates create-only push succeeds on primary team.
    • Verifies failing secondary team state endpoint is never queried.

Validation run:

  • CGO_ENABLED=1 go test -tags gms_pure_go ./internal/linear/...
  • make test ❌ (existing environment/baseline failures unrelated to this change: missing dolt binary and an existing cmd/bd network-behavior test failure).
Open in Web View Automation 

Co-authored-by: Kev Glynn <kev-pryon@users.noreply.github.com>
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