rojo icon indicating copy to clipboard operation
rojo copied to clipboard

Upgrade `notify` as a dependency of `memofs`

Open Dekkonot opened this issue 2 years ago • 0 comments

The version of notify we are using as a backend for memofs is over 3 years out of date. In that time, Apple has released its own chips, MacOS has undergone 3 revisions, and Windows 11 released. Notify has gone from v4 to v6, and has changed dramatically. If for no other reason than tech debt, we should upgrade. However, there is also the potential for this to fix significant performance problems people are running into on M1 chips since it is both more up to date and supports an alternative watcher backend for MacOS.

However, upgrading is non-trivial. Starting with v5, Notify removed the debounce watcher we use. They did publish an upgrade guide here but it is slightly out of date (one of the examples it links to no longer exists) and more importantly states the following:

The old DebouncedEvent is completely removed. notify-debouncer-mini only reports an Any like event (named DebouncedEvent too), as relying on specific kinds (Write/Create/Remove) is very platform specific and can't be guaranteed to work, relying on a lot of assumptions.

We rely on the specific kinds of events being reported, as you can see here.

It's by no means impossible, but upgrading notify will require us to reconsider the way we process changes in StdBackend since it currently relies heavily on knowing the reported type of event from the watcher.

Dekkonot avatar Jul 12 '23 21:07 Dekkonot