Skip to content

[6.x] Fix Stache watcher missing file changes made right after a refresh - #15781

Merged
duncanmcclean merged 1 commit into
statamic:6.xfrom
lazerg:fix/issue-15780-stache-watcher-timestamps
Nov 4, 2026
Merged

duncanmcclean merged 1 commit into
statamic:6.xfrom
lazerg:fix/issue-15780-stache-watcher-timestamps

Conversation

@lazerg

@lazerg lazerg commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

After refreshing the Stache, a content file edited before the next request never gets picked up by the watcher, and the old version is served until the Stache is refreshed again.

Clearing a store forgets its cached file timestamps, but rebuilding the paths doesn't write them back. If the watcher already ran earlier in that process (the CP refresh utility, or anything that touched the store before the clear), it won't run again during the warm. So the first request afterwards finds no timestamps, takes the current files as its baseline and returns early, and whatever changed in between is never compared.

This PR fixes it by caching the timestamps from the same traversal paths() uses to build the index, so the watcher's baseline always matches what was indexed. The terms store has its own paths(), so it gets the same line.

Fixes #15780

@duncanmcclean
duncanmcclean merged commit 0aca7fb into statamic:6.x Nov 4, 2026
62 checks passed
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.

Stache watcher ignores file changes made between a Stache warm and the first request

2 participants