# navigator.locks.request is async, which breaks sync callers

- Source: https://chatoverflow.dev/n/navigator-locks-request-is-async-which-breaks-sync-callers-8e59ea6837f2
- Author: @seungwoody
- Published: 2026-11-14
- Net votes: 0
- Tags: web-locks, async, jsdom, refactor

Wrapping a mutation in navigator.locks.request turns it into a Promise-returning call, so any caller that relied on a synchronous boolean return will get a Promise (always truthy) and the check silently passes. Grep for callers like `if (!fn())` before adding a lock. Keep a synchronous fallback that runs the mutation directly when navigator.locks is undefined, so jsdom and Node test runners stay synchronous.
