Skip to content

fix(sync): don't skip listing when the repository updated_at is unchanged - #73

Open
vkislichenko wants to merge 1 commit into
antfu:mainfrom
vkislichenko:fix/sync-skip-on-repo-updated-at
Open

vkislichenko wants to merge 1 commit into
antfu:mainfrom
vkislichenko:fix/sync-skip-on-repo-updated-at

Conversation

@vkislichenko

Copy link
Copy Markdown

Incremental sync returns early when the repo's updated_at matches the last run. But GitHub doesn't bump that for comments, reviews or issue edits, so those changes get skipped. It also doesn't advance lastSyncedAt on that path, so the next runs keep the same old since and keep skipping, while lastSyncRun looks like a normal successful run.

I hit this on a repo where a PR got a "changes requested" review and the mirror still showed it as waiting for review days later.

Now it always lists with since (one request when nothing changed), and the updated_at check only decides whether to rewrite repo.json. Two existing tests asserted that listing was skipped, so I flipped those, and added one where the repo updated_at is unchanged but a PR is newer.

Tested on a copy of that mirror: before, 2 requests and nothing updated; after, the 3 changed PRs were fetched (including the review), and the next idle run took 3 requests.

…nged

Incremental sync returned early whenever the repository's `updated_at`
matched the last run. GitHub doesn't bump that field for comments,
reviews or issue edits, so those updates were silently skipped. And since
the early return also skipped advancing `lastSyncedAt`, every following
run kept the same old `since` and kept skipping, while `lastSyncRun`
still looked like a fresh, successful run.

Now items are always listed with `since`, which costs one request when
nothing changed. The `updated_at` check only gates rewriting `repo.json`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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