gettakaro / takaro

16 stars 5 forks source link

Detect and track file changes #1010

Open emielvanseveren opened 6 months ago

emielvanseveren commented 6 months ago

Since users can edit files simultaneously we need to make sure they don't override each others changes. We could keep track of the latest change timestamp or a hash of the function code. Whenever a user wants to make a change it passes this timestamp or hash. If it does not match with the server side we reject the change and prompt the user that changes to this file already have been made and the user should refresh the page. This gives the user the option to e.g. open the updated function in a new tab and include his changes.

niekcandaele commented 2 weeks ago

We can use the HTTP header If-Match for this (like Tailscale)