Skip to content

file_watcher does not reload assets on all file changes #10576

Open
@SludgePhD

Description

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.

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions