Repository navigation
fix(importer): evaluate reconciler leniency relative to wall-clock time - #6305
Merged
Merged
Conversation
another-rex
force-pushed
the
fix-reconciler-leniency
branch
from
November 4, 2026 03:26
19f98e0 to
9bc2859
Compare
another-rex
commented
Nov 4, 2026
Contributor
Author
There was a problem hiding this comment.
I am a bit suspicious of the usefulness of these new tests.
michaelkedar
previously approved these changes
Nov 4, 2026
Previously, `checkReconcile` and `processUpdate` (`ActionReconcile`) checked `modified.After(dbMod.Add(ReconcileLeniencyDuration))`, which permanently skipped any missed upstream update whose `modified` timestamp was within 6 hours of the record's previous `modified_raw` timestamp in Datastore. Evaluate `ReconcileLeniencyDuration` relative to wall-clock `now` (`now.Sub(modified) > ReconcileLeniencyDuration`) while comparing `modified` against `dbMod` at whole-second precision so feeds whose index includes sub-second timestamps (e.g. Chainguard's `all.json`) do not falsely trigger reimports against whole-second individual advisory files.
another-rex
force-pushed
the
fix-reconciler-leniency
branch
from
November 4, 2026 03:58
9bc2859 to
9b2f02d
Compare
michaelkedar
approved these changes
Nov 4, 2026
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.
Overview
Fixes
importer-reconcilerpermanently skipping outdated records whose upstreammodifiedtimestamp is withinReconcileLeniencyDuration(6 hours) of the previousmodified_rawversion stored in Datastore (such asCGA-7f3h-rrc2-p5fw).Details
Evaluate leniency relative to
nowinstead ofdbMod: we previously checkedmodified.After(dbMod.Add(ReconcileLeniencyDuration)), measuring the gap between two versions of the record (modified - dbMod > 6h) rather than how recently the upstream modification occurred (now - modified > 6h). Any missed update published within 6 hours of its prior revision was never fixedCompare
modifiedvsdbModat whole-second precision: Upstream index feeds such as Chainguard'sall.jsonemit millisecond precision (2026-10-07T02:17:41.861Z) while their individual<id>.jsonendpoints truncate to whole seconds (2026-10-07T02:17:41Z). Truncating is not ideal (This really is more of a chainguard issue), but it's a quick fix.agy