Open jldec opened 3 weeks ago
since we need to keep watching the file after rename.
In what scenario will a file be renamed?
I assume that the file name will be the (human) id of the message. By definition, the human id will never change
Right, the filename known to git should not change.
The idea for this is to use a temp filename during the write, and then rename that to replace the versioned filename, when the file is fully persisted on disk. This (hopefully) makes the changes to the file atomic.
Context
If the store process exits during a write, files should not be left in a partially written state.
Proposal
First write to a temp file and then rename.
This is related to https://github.com/opral/inlang-message-sdk/issues/80, since we need to keep watching the file after rename.