Skip to content

build: clear processed incremental changes - #2534

Open
ZluxYao wants to merge 1 commit into
jackyzha0:v5from
ZluxYao:fix/clear-incremental-changes
Open

ZluxYao wants to merge 1 commit into
jackyzha0:v5from
ZluxYao:fix/clear-incremental-changes

Conversation

@ZluxYao

@ZluxYao ZluxYao commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • clear changesSinceLastBuild after a successful incremental rebuild
  • clear the record in place to preserve references held by queued rebuilds
  • add a regression test for the in-place state cleanup

Reproduction

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 check
  • npm test (164 tests passed)

This PR was written entirely using an LLM.

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
quartz ✅ Ready (View Log) Visit Preview f5fa234

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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() and ChangeRecord to standardize and safely clear the incremental change-tracking map in place.
  • Clear changesSinceLastBuild after 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

1 active deployment
Branch Preview — f5fa2343 Deployed Aug 25, 2026 by github-actions[bot]
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.

2 participants