Repository navigation
fix(sync): mirror upstream metadata edits on every sync - #12
Merged
Merged
Conversation
An upstream PATCH (title, description, group, deprecated) only bumps updatedAt, so the npm dataUpdatedAt fast path skipped it and mirrors kept stale metadata forever. Metadata is now mirrored on every sync, and fields removed upstream are unset. File artefacts use the same dataUpdatedAt fast path instead of re-downloading on any upstream PATCH.
…lback Upstream artefacts predating dataUpdatedAt are stored with updatedAt as fallback; comparing against the raw field re-downloaded them on every sync.
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.
Mirrored artefacts now pick up upstream metadata edits (title, description, group, category, deprecated) on every sync, and fields removed upstream are unset on the mirror.
Why: a catalog's title edited upstream never reached the prod mirror, even with Sync now. An upstream PATCH only bumps
updatedAt, so thedataUpdatedAtfast path insyncNpmArtefactreturned before touching metadata.syncMetadataruns on both the fast path and the download path.dataUpdatedAtfast path as npm instead of comparingupdatedAt, which re-downloaded the whole file on any upstream PATCH.dataUpdatedAt || updatedAt), so upstream docs predatingdataUpdatedAtare no longer re-downloaded on every sync.Heads-up: metadata is now strictly upstream-owned: a field missing upstream is
$unsetlocally. Mirrors can't edit these fields locally anyway (PATCH rejects them), so nothing local is lost.