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

SQLite database changes are not reported correctly under macOS #613

Open
mqudsi opened this issue Jul 9, 2024 · 2 comments
Open

SQLite database changes are not reported correctly under macOS #613

mqudsi opened this issue Jul 9, 2024 · 2 comments

Comments

@mqudsi
Copy link

mqudsi commented Jul 9, 2024

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.db and foo.db-wal).
  • Spin up a process to write to that database
  • In a separate process, use notify to 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.

@0xpr03
Copy link
Member

0xpr03 commented Jul 14, 2024

Are you using kqueue or FSEvents to watch the file ?

@mqudsi
Copy link
Author

mqudsi commented Jul 15, 2024

The same thought occurred to me when I ran into this, but unfortunately this observed behavior is the same with both KqueueWatcher and FsEventWatcher.

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

No branches or pull requests

2 participants