notify
notify copied to clipboard
SQLite database changes are not reported correctly under macOS
This is a known issue (albeit for unknown reasons) under macOS, but I wanted to log it here for posterity and as a reference for other macOS notify users.
System details
- OS/Platform name and version: macOS 10.10 - 10.11+
- Rust version (if building from source):
rustc --version: N/A - Notify version (or commit hash if building from git): 6.1.1
- If you're coming from a project that makes use of Notify, what it is, and a link to the downstream issue if there is one: My iMessage client for Windows
- Filesystem type and options: hfs
What you did (as detailed as you can)
- Create an SQLite database configured to use a write-ahead log (so it writes to
foo.dbandfoo.db-wal). - Spin up a process to write to that database
- In a separate process, use
notifyto monitor that directory
What you expected
Notifications would be received when the writeahead log is written to or when the WAL is merged back into the db.
What happened
No notifications are received for the database or the WAL. (Manually poking the file with touch foo.db-wal works.)
Since SQLite doesn't really use special APIs to perform file I/O under macOS, the assumption is that there is actually an entire class of writes that don't get caught.