Skip to content
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

file_watcher does not reload assets on all file changes #10576

Open
SludgePhD opened this issue Nov 15, 2023 · 1 comment
Open

file_watcher does not reload assets on all file changes #10576

SludgePhD opened this issue Nov 15, 2023 · 1 comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior

Comments

@SludgePhD
Copy link
Contributor

Bevy version

0.12

[Optional] Relevant system information

This is on Arch Linux and may not reproduce on other OSes.

What you did

Enable the file_watcher feature and use Krita to edit and overwrite a .png in the assets folder.

What went wrong

The asset was not reloaded.

Additional information

I've added logging to the file watcher and the logs look like this:

2023-11-15T21:46:55.234399Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Remove(File), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/soyR.png~"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41791, tv_nsec: 238759780 } }
2023-11-15T21:46:56.660576Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Remove(File), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/soyR.png"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41792, tv_nsec: 629211904 } }
2023-11-15T21:46:56.660599Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Create(File), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/soyR.png"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41792, tv_nsec: 629295051 } }
2023-11-15T21:46:56.660605Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Modify(Data(Any)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/soyR.png"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41792, tv_nsec: 629496794 } }
2023-11-15T21:46:56.660617Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Access(Close(Write)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/soyR.png"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41792, tv_nsec: 629499589 } }
2023-11-15T21:46:56.677479Z  INFO bevy_asset::server: Reloading soyR.png because it has changed
2023-11-15T21:47:16.251203Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Modify(Data(Any)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/#42242008"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41812, tv_nsec: 221865734 } }
2023-11-15T21:47:16.251236Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Create(File), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/soyR.png~"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41812, tv_nsec: 224080219 } }
2023-11-15T21:47:16.251245Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Access(Close(Write)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/#42242008"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41812, tv_nsec: 224084517 } }
2023-11-15T21:47:18.277851Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Modify(Metadata(Any)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/#42242009"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41814, tv_nsec: 255643983 } }
2023-11-15T21:47:18.277883Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Modify(Data(Any)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/#42242009"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41814, tv_nsec: 312283508 } }
2023-11-15T21:47:18.352962Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Modify(Data(Any)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/#42242009"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41814, tv_nsec: 361439227 } }
2023-11-15T21:47:18.352998Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Create(File), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/soyR.png"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41814, tv_nsec: 363762208 } }
2023-11-15T21:47:18.353004Z DEBUG bevy_asset::io::file::file_watcher: DebouncedEvent { event: Event { kind: Access(Close(Write)), paths: ["/home/sludge/code/Artifice/crates/artifice/../../assets/#42242009"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }, time: Instant { tv_sec: 41814, tv_nsec: 363766797 } }

You can see that the first reload happens correctly (this is in response to me reverting previous changes via git), but there is no second reload after the file has been replaced by Krita.

@SludgePhD SludgePhD added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 15, 2023
@Testare
Copy link
Contributor

Testare commented Nov 16, 2023

Related cause, different symptoms: #10573

@nicopap nicopap added A-Assets Load files from disk to use for things like images, models, and sounds and removed S-Needs-Triage This issue needs to be labelled labels Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants