Skip to content

fix(linear): avoid repeated batch updates for unchanged structured issues - #15

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

fix(linear): avoid repeated batch updates for unchanged structured issues#15
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-c771

Conversation

@cursor

@cursor cursor Bot commented Jun 18, 2026

Copy link
Copy Markdown

Summary

Fixes a critical batch-sync regression where unchanged Linear issues could be re-updated on every sync when AcceptanceCriteria, Design, or Notes were present.

Bug + impact

When batch push receives issues whose Description was already formatted by engine hooks, skip comparison re-ran formatting and produced a different string. This made unchanged issues look modified, causing repeated updates and avoidable rate-limit pressure that can break large sync runs.

Root cause

BatchPush used PushFieldsEqual(local, remote, ...), which always calls BuildLinearDescription(local). In batch mode, local.Description may already be pre-formatted while structured fields remain populated, so re-formatting duplicated appended sections in-memory and defeated skip detection.

Fix

  • Added a batch-safe description normalizer that detects already-formatted payloads.
  • Used that normalized description for:
    • skip comparisons,
    • single-create duplicate-title path,
    • batch-create payload construction,
    • update payload description field.
  • Added regression test: TestBatchPush_SkipsUnchangedIssue_WithStructuredFields.

Validation

  • CGO_ENABLED=1 go test -tags gms_pure_go ./internal/linear -run 'TestBatchPush_SkipsUnchangedIssue|TestBatchPush_SkipsUnchangedIssue_WithStructuredFields|TestBatchPush_ForceBypassesSkip'
  • make test (fails in unrelated pre-existing environment-dependent tests in cmd/bd and internal/storage/dolt, including missing dolt binary and existing network-assumption assertions)
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