Skip to content

fix(lists): deleteOwnedList unserialized, can race with item mutations #7725

Open

Description

@NotThatKindOfDrLiz

Summary

deleteOwnedList is not serialized through the per-list operation lane, allowing concurrent mutations that can corrupt the deletion state.

Root Cause

  • _serializeListOperation exists for all other mutations (line 110)
  • deleteOwnedList (line 698) does not call it
  • Concurrent item mutations + delete can interleave
  • Delete publishes NIP-09 deletion, but concurrent item add is not blocked

Impact

  • Race condition: Item added while deletion is in flight
  • Inconsistent state: Item exists locally but deletion says it's gone
  • User-visible bug: Item re-appears after user confirms deletion

Technical Details

  • deleteOwnedList calls _publishListToNostr directly without serialization
  • _serializeListOperation usage pattern established in _createList, _commitListMutation, _updateList
  • Missing await on serialization lane allows interleaving

Required Fixes

  1. Wrap deleteOwnedList logic in _serializeListOperation
  2. Add test: concurrent delete + item add produces consistent state
  3. Verify NIP-09 deletion publishes after all pending mutations complete

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions