You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
buzz-db: extract replaceable-event logic from lib.rs #6
replace_addressable_event (~150 lines) and replace_parameterized_event (~200 lines) in lib.rs contain complex transactional SQL with advisory locks, stale-write detection, NIP-16/NIP-33 replacement semantics, and mention indexing. This is event-storage logic that belongs with the other event operations.
Proposed change
Move both methods into event.rs (where insert_event, query_events, soft_delete_event already live). Alternatively, if event.rs grows too large, create a dedicated replaceable.rs module. The event_replacement_lock_key helper function (currently in lib.rs) moves with them.
Priority
Medium — high-complexity code in the wrong location, naturally done alongside #2.
🤖 AI review update (2026-08-23)
Do this together with #4 and the narrow transaction work from #3. Prefer a dedicated replaceable.rs rather than growing event.rs beyond its current size. The module should own coordinate construction, advisory locking, stale-write/tie semantics, replacement mutation, mention indexing, and focused concurrency/rollback tests.
Completed by block#6777 (merged 2026-08-26): replaceable-event methods, SQL, locking, tests, and datastore spans now live in the dedicated replaceable store.
Activity
Centralize replaceable event persistence (#6660)
refactor(db): finish replaceable event store extraction (#6777)
refactor(db): extract domain stores from database runtime (#6987)
refactor(db): extract domain stores from database runtime (#6987)
TheSentinel454 commentedon Sep 3, 2026
Completed by block#6777 (merged 2026-08-26): replaceable-event methods, SQL, locking, tests, and datastore spans now live in the dedicated replaceable store.
Centralize replaceable event persistence (block#6660)
refactor(db): finish replaceable event store extraction (block#6777)
refactor(db): extract domain stores from database runtime (block#6987)