GH-96: fix(linear): SyncAdapter correctness — TransitionState name→id, paginated idem comment scan, on-or-after delta (post-merge review of #94)#99
Merged
Conversation
…scan, on-or-after delta, UpdateFields validation Post-merge review of #94 found four defects in sdk/integrations/linear/sync.go: TransitionState sent a state NAME straight through as a GraphQL stateId (round-trip broken); AddComment's idempotency scan only checked the first comments page, letting retries duplicate-post once a marker fell off page 1; ListUpdatedSince used gt+second-truncated timestamps, silently dropping issues updated exactly at the watermark; and UpdateFields silently ignored unknown keys and wrongly-typed values instead of rejecting the patch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Automated PR created by Pilot for task GH-96.
Closes #96
Changes
GitHub Issue GH-96: fix(linear): SyncAdapter correctness — TransitionState name→id, paginated idem comment scan, on-or-after delta (post-merge review of #94)
Context
PR #94 (Linear SyncCapable, issue #92) merged with three correctness defects found in post-merge review (2026-07-13). Nothing consumes SyncCapable yet (sync engine is a later milestone), so fixes are non-breaking.
Implementation
All in
sdk/integrations/linear/sync.go:IssueSnapshot.Statecarries the workflow state NAME, butTransitionState(sync.go:332) passes providerState straight toClient.UpdateIssueState, which sends GraphQLstateId— writing back a read state name fails the mutation. Resolve name→state-UUID via a per-team workflow-state lookup (pattern: resolveTeamID / GetTeamDoneStateID), accept BOTH a state id and a name, and add a test for the name path.updatedAt: { gt: $since }with RFC3339 second truncation — an issue updated exactly at the whole-second watermark is silently dropped (lost-update class). Switch togte+time.RFC3339Nano(UTC); callers dedupe by NativeID. Update the method doc comment in lockstep.UpdateFieldsmust return an error for unrecognized keys / wrongly-typed values instead of silently dropping them and returning a fresh snapshot as if applied.Acceptance
Refs
Planned Steps (execute all in sequence)