[CRITICAL] Unstable Custom Scripts and Save Button that Doesnt Save

I realized that after an upgrade last week which landed me on this version:

ERPNext: v8.4.3 (master)
Frappe Framework: v8.4.1 (master)

that custom script all behave very weirdly. Say I hook to refresh, this custom script doesnt seem to run every time anymore. It used to run when the document was open, document was saved, document was submitted etc. Now it runs in a very unpredicted fashion. It runs sometimes and doesnt run most of the other times.

In fact, the Save button also has this weird behavior. Sometimes you can click it and it saves, other times, the save button greys out and nothing happens.

Did someone patch the system to change the behavior of any of this? It is terribly unstable and has affected a ton of the system that we have.

Can you share your custom script?

If it feel unpredictable, most likely, you might be triggering multiple ajax calls in parallel and your result will vary on basis of what gets completed first.