I’ve reported this happening before, and I think I’ve lost a good bit of code because of this issue (I asked about this in the general slack channel after the outage @mark-piller).
Steps:
I was working on a Cloud Code API
I needed to check and change something in a different API
I used the browser tree (right side of the Cloud Code section) to change to a different API codeless logic
I started making some changes, and went to look for some logic I added yesterday and it was missing.
The logic is on the server, but not being displayed to the client
If I had not noticed this and deployed the code, I would have overwritten my changes from yesterday. This has 100% happened to me in the past and it sucks but I’ve never caught the specifics of how it happened.
If I go into the code from the navigation tree, why would it not load up the most recent version from the server? How do I always force the latest version to make sure I don’t overwrite changes?
do you use one computer for work, or perhaps more than one?
Is it possible that you are using the same computer, but different browsers, or are you opening console in incognito mode in parallel?
It seems like the issue is the client code gets stale when working with multiple tabs. I use multiple tabs to reference or copy and paste code from other APIs. Or I have a data browser tab open to get the column names or one of a hundred other reasons.
In this case I don’t think I went to the timer code in this tab, so why was it trying to deploy that client code up?
It appears that both utils API service and the directFulfillment timer belong to the utilsdeployment model. In fact, the title of the popup says Deploy utils model.
Deployment models is an extremely important concept in Cloud Code. One of the rules associated with deployment models is that they are deployed as a whole. Meaning you cannot deploy only a part of the deployment model. Instead, the entire model is deployed, even if some parts of it haven’t changed.
Another rule says that when a model is deployed, the version of it that runs in production is removed and replaced by what you deploy.