opral / inlang-message-sdk

0 stars 0 forks source link

File watcher doesn't watch renamed files #53

Open jldec opened 1 month ago

jldec commented 1 month ago

MESDK-91

In order to make updates more atomic, I tried to implement a pattern of writing a JSON structure to a temp file and then renaming that to replace the original message file.

It appears that the watcher on the original message file stops reacting to changes on the message file after the rename

(modifled code is in https://github.com/opral/monorepo/pull/2758)

Context

The translated changes to messages.json are not picked up by the watching process.

jldec commented 1 month ago

assigning @jan.johannes (suspected lix file watch issue)
repro in https://github.com/opral/monorepo/pull/2758

jldec commented 1 month ago

please see https://github.com/opral/monorepo/pull/2758#issuecomment-2107663445

janfjohannes commented 1 month ago

@jldec closing as behaves as expected. rename is not part of the lix fs api and known to cause plenty of issues in existing nodejs watch module as well. this cannot really be fixed until lix.fs implementation.