Reference
Conflict handling
How storage.watch reports changes, last-write-wins semantics for object keys, and per-namespace rollback on failure.
storage.watch reports whole-key changes.
Understand last-write-wins
Object-valued keys use last-write-wins at the whole-value level — not field-level merge. Two tabs writing different fields on the same object key can overwrite each other.
Handle persistence failure
Each namespace's writes are independent. On persistence failure, only that namespace rolls back. Other namespaces keep their last successful state.
Design for independence
Split state that changes at different rates into separate namespaces (for example config in browser storage and draft in memory). This limits cross-tab conflicts and keeps rollback scoped.