Skip to content

fix(watch): preserve final writes in debounce bursts#81

Open
reneleonhardt wants to merge 1 commit into
JordanCoin:mainfrom
reneleonhardt:fix/watch-debounce-followup
Open

fix(watch): preserve final writes in debounce bursts#81
reneleonhardt wants to merge 1 commit into
JordanCoin:mainfrom
reneleonhardt:fix/watch-debounce-followup

Conversation

@reneleonhardt

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Keep the first write immediate and coalesce changed rapid writes into one newest trailing event per path.
  • Compare cached size and modification time so same-size edits are not mistaken for duplicate notifications.
  • Check the graph cache before os.Stat, avoiding that syscall for missing/untracked paths.
  • Cancel pending writes before lifecycle events and wait for the final pending drain during shutdown.

Type of change

  • Bug fix
  • New feature
  • New language support
  • Documentation
  • Other (describe below)

Checklist

  • I've tested this locally with the race detector.
  • I've read CONTRIBUTING.md.
  • I've updated documentation if needed.

Additional notes

This follows the three review observations on #78: preserve same-size edits with modification time, add a trailing edge for changed bursts, and consult cached state before filesystem inspection. The event loop remains the sole owner of the timer and pending map.

The test matrix now covers Go 1.24 through 1.26. The previous 1.21–1.23 labels no longer exercised those toolchains because the Go 1.24 module minimum caused automatic toolchain replacement.

Verification includes 20 consecutive focused race runs, the full macOS Go 1.26.5 race/coverage suite, go vet ./..., the full Linux Go 1.24 race/coverage suite, and 95.76% changed executable production-line coverage. Final adversarial review found no remaining Critical or Important issues.

Developed with carefully directed, manually reviewed AI assistance.

Co-Authored-By: GPT-5.6 Sol codex@openai.com

Co-Authored-By: GPT-5.6 Sol <codex@openai.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