Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is localized, addresses the stated incremental rebuild bug directly, and includes a focused regression test for the in-place cleanup behavior.
Pull request overview
This PR fixes incremental rebuild state management by ensuring changesSinceLastBuild is cleared after a successful rebuild, preventing previously processed change events from being re-parsed and re-emitted on later rebuilds. It introduces a small utility to clear the change record in place (preserving object identity for any queued rebuilds) and adds a regression test for that behavior.
Changes:
- Introduce
clearChangeRecord()andChangeRecordto standardize and safely clear the incremental change-tracking map in place. - Clear
changesSinceLastBuildafter a successful rebuild to avoid replaying prior changes. - Add a regression test ensuring the record is cleared without replacing the object reference.
File summaries
| File | Description |
|---|---|
| quartz/util/incremental.ts | Adds ChangeRecord and an in-place clearChangeRecord() helper. |
| quartz/util/incremental.test.ts | Adds a regression test confirming the record is cleared in place. |
| quartz/build.ts | Uses ChangeRecord for changesSinceLastBuild and clears it after successful rebuild completion. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch was successfully deployed
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
changesSinceLastBuildafter a successful incremental rebuildReproduction
After each successful incremental rebuild, previously processed changes remain in
changesSinceLastBuild. Later rebuilds parse and emit those old changes again.This causes the number of parsed files to accumulate across otherwise unrelated edits and can replay old delete events.
Testing
npm run checknpm test(164 tests passed)This PR was written entirely using an LLM.