Handling concurrency on the Web with Web Locks API
Case study 6 min +60 XP
OLX uses the browser's Web Locks API to stop multiple open tabs from each resuming the same large (up to 20GB) S3 upload after a restart. localStorage-plus-polling suffers from non-atomic writes and stale locks, and BroadcastChannel forces you to hand-roll a coordination protocol, whereas navigator.locks offers an atomic mutex that is released automatically when a tab closes or crashes.