Skip to content

fix: check dest_path when filtering watchdog reload events - #872

Merged
craigbarratt merged 1 commit into
custom-components:masterfrom
dmamelin:watchdog-dest-path-fix
Sep 11, 2026
Merged

craigbarratt merged 1 commit into
custom-components:masterfrom
dmamelin:watchdog-dest-path-fix

Conversation

@dmamelin

Copy link
Copy Markdown
Contributor

Fixes #871

Editors that save atomically (temp file + os.replace/rename — e.g. Blueprint Studio) surface as a FileMovedEvent where src_path is the temp file name and dest_path is the real script path. check_event only checked src_path, so these saves were silently ignored and the reload never fired.

Now both src_path and dest_path are checked against the allowed suffixes.

Testing

check_event currently has no dedicated tests - the watchdog wiring itself is mocked out everywhere it's touched. Given the fix is a one-line, low-risk check (also inspect dest_path for moved events), I kept this PR minimal rather than doing an unrelated refactor to make check_event independently testable. Happy to extract it to a module-level function and add unit tests if you'd like coverage for this specific case.

@craigbarratt

Copy link
Copy Markdown
Member

Thank for the PR - looks good.

@craigbarratt
craigbarratt merged commit 62cae41 into custom-components:master Sep 11, 2026
6 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.

No automatic reload after editing files

2 participants