-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: treat any data change as a modification #2542
Conversation
96a0f39
to
5a9b22f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that looks ok to me, if other people can confirm if it fixes the issue for them
@apiraino, @Jieiku, @cart, @martin-t, can any of you confirm this fix in your environment? If you want to install:
Or, just do the first 2 steps then It fixes mine. |
For unknown reasons, it seems some environments emit a `DataChange::Any` event, rather than specifying content or size, when a file is edited. As an example: [src/fs_utils.rs:72:9] &event = DebouncedEvent { event: Event { kind: Modify( Data( Any, ), ), paths: [ "/home/redacted/content/blog/2024-06-23_example.md", ], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None, }, time: Instant { tv_sec: 78544, tv_nsec: 936740729, }, } Consequently, because this isn't treated by Zola as a modification, the site is not rebuilt, which regresses on previous behavior. This patch fixes this particular case by treating any data modification events as a modification. Closes: getzola#2536
Ty for checking! I've made the PR a little more complete by also adding a modification event for |
@@ -202,7 +209,7 @@ mod tests { | |||
]; | |||
for (case, expected) in cases.iter() { | |||
let ek = get_relevant_event_kind(&case); | |||
assert_eq!(ek, *expected); | |||
assert_eq!(ek, *expected, "case: {:?}", case); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just useful when debugging to actually see the case that failed when the assertion failed.
I am headed out to do some work, but just let me know if you need anything else tested, and I will test it once I get back home. |
@Keats looks like we have confirmation from someone else on a different OS than me (arch vs fedora). |
Noticed the same issue while working on my website. Came across the issue and this PR, and I can also confirm that this fixes the problem and changes are properly detected again! Thanks for the quick fix! Edit: In case it's useful, I'm on arch linux as well. |
Thank you for this! I implemented filtering to make sure we don't overreact to some super fine-grained events (ex: |
while working on #2507 i discovered this bug and fixed it locally (I think i fixed it in the exact same way as this MR, too) but assumed it was just a weird NixOS edge case or something and didn't think to report it :P |
For unknown reasons, it seems some environments emit a `DataChange::Any` event, rather than specifying content or size, when a file is edited. As an example: [src/fs_utils.rs:72:9] &event = DebouncedEvent { event: Event { kind: Modify( Data( Any, ), ), paths: [ "/home/redacted/content/blog/2024-06-23_example.md", ], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None, }, time: Instant { tv_sec: 78544, tv_nsec: 936740729, }, } Consequently, because this isn't treated by Zola as a modification, the site is not rebuilt, which regresses on previous behavior. This patch fixes this particular case by treating any data modification events as a modification. Closes: #2536
For unknown reasons, it seems some environments emit a `DataChange::Any` event, rather than specifying content or size, when a file is edited. As an example: [src/fs_utils.rs:72:9] &event = DebouncedEvent { event: Event { kind: Modify( Data( Any, ), ), paths: [ "/home/redacted/content/blog/2024-06-23_example.md", ], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None, }, time: Instant { tv_sec: 78544, tv_nsec: 936740729, }, } Consequently, because this isn't treated by Zola as a modification, the site is not rebuilt, which regresses on previous behavior. This patch fixes this particular case by treating any data modification events as a modification. Closes: getzola#2536
fix: treat any data change as a modification
For unknown reasons, it seems some environments emit a
DataChange::Any
event,rather than specifying content or size, when a file is edited. As an example:
Consequently, because this isn't treated by Zola as a modification, the
site is not rebuilt, which regresses on previous behavior.
This patch fixes this particular case by treating any data modification
events as a modification.
Closes: #2536
IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.
The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one: