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.
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.