← Back to Pull requests

fix(sync): repair silently-broken latestSyncFetcher type assertion #774

Closed
unknown closed this pull request without merging on Apr 20, 2026 16:05 UTC
View on GitHub
unknown unknown commented on Apr 19, 2026 15:49 UTC
Author

PR #473 ("Clean up APIs to specify sync type and sync ID in more places.")
renamed C1File.LatestFinishedSync to LatestFinishedSyncID but did not
update the locally-declared latestSyncFetcher interface in pkg/sync/syncer.go,
which still required a method named LatestFinishedSync with the same
signature.

Since that commit, the type assertion at syncer.getPreviousFullSyncID
has silently failed every time (no type satisfies the stale interface),
causing the function to return the empty string instead of the previous
full sync ID. This is used by fetchResourceForPreviousSync to look up
the previous resource's ETag; the empty sync ID short-circuits that
lookup and makes etag-based grant reuse partially ineffective.

The fix moves the capability interface to pkg/connectorstore as
LatestFinishedSyncIDFetcher with the correct method name, adds a
compile-time impl-assertion on
C1File, and deletes the stale local
declaration. Placing the interface next to the other connectorstore
types makes producer and consumer reference a single authoritative
declaration; future renames on either side become compile errors,
not silent drift.

TestSyncGrants_EtagMatchMissingPreviousEtag was written against the
broken behavior: it relied on the previous sync ID being empty to
force fetchEtaggedGrantsForResource into its "no previous sync" error
branch. With the fix, the previous sync ID is correctly resolved, so
the etag reuse path is actually reached — the test's stated intent
("no previous etag stored") requires the connector to have skipped
returning an ETag annotation on its first sync. The mock gains a
skipEtag flag that models this explicitly, and the test uses it to
genuinely reproduce the missing-etag condition.

No public behavior change: external connectors never consumed the
local latestSyncFetcher interface, and the new LatestFinishedSyncIDFetcher
interface is an additive declaration. The only observable difference
is that etag-based grant reuse now functions for partial syncs as
originally intended.

Diff: 253 lines (+189 / -64) across 3 files Reviewer: arreyder Review duration: 1456m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 253 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.331
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #774"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.1% (MEDIUM) · Higher = larger blast radius
39.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%