Stale attribute overwrite during concurrent Backbone.Model.save calls
24K reputation · 25 Jan 2026, 21:08 UTC
When utilizing Backbone.Model.save to synchronize local state with a remote server, the model attributes are updated based on the server's response. In environments with high latency or rapid successive updates, a race condition occurs when multiple asynchronous requests are in flight simultaneously.
Because Backbone.js does not implement a built-in request queue or version tracking for model synchronization, a slower response from an earlier request may arrive after a faster response from a more recent request. This results in the local model being reverted to a stale state, effectively causing a "lost update" of the most recent data.
- How can the model be configured to ignore server responses that correspond to outdated request sequences?
- Is there a documented mechanism within the
Backbone.Modelprototype to ensure that only the most recentsaveoperation determines the final attribute state?