fix: remove deleted rooms from space navigation after refresh #200

Merged
bhavishy2801 merged 2 commits from bhavishy2801/flotilla:fix-room-delete-partial-failure into dev 2026-04-14 15:43:49 +00:00
Contributor

Summary

This PR fixes a bug where deleting a room succeeded on the relay, but the room could still appear in space navigation (including after refresh).

Fixes #194.

Root Cause

Room list derivation did not consistently treat delete events as authoritative in edge cases:

  • Delete timestamp aggregation could involve an undefined prior value.
  • Room meta events with the same second-level timestamp as a delete event were still considered active.

Changes

  • Updated room delete timestamp aggregation logic to handle first delete event safely.
  • Updated room filtering condition so a room is excluded when its meta timestamp is less than or equal to the delete timestamp.
  • This ensures deleted rooms are not shown in navigation immediately or after reload.

Validation

  • pnpm run check passed.
  • pnpm run lint passed.

Testing

  • In a NIP-29 space, create a temporary room.
  • Delete the room from room details.
  • Confirm it disappears from navigation immediately.
  • Hard refresh and confirm it does not reappear.
  • Reopen app/session and confirm it remains absent.
  • Repeat by creating/deleting another room quickly (same-minute timestamp edge case).
## Summary This PR fixes a bug where deleting a room succeeded on the relay, but the room could still appear in space navigation (including after refresh). Fixes #194. ## Root Cause Room list derivation did not consistently treat delete events as authoritative in edge cases: - Delete timestamp aggregation could involve an undefined prior value. - Room meta events with the same second-level timestamp as a delete event were still considered active. ## Changes - Updated room delete timestamp aggregation logic to handle first delete event safely. - Updated room filtering condition so a room is excluded when its meta timestamp is less than or equal to the delete timestamp. - This ensures deleted rooms are not shown in navigation immediately or after reload. ## Validation - `pnpm run check` passed. - `pnpm run lint` passed. ## Testing - [x] In a NIP-29 space, create a temporary room. - [x] Delete the room from room details. - [x] Confirm it disappears from navigation immediately. - [x] Hard refresh and confirm it does not reappear. - [x] Reopen app/session and confirm it remains absent. - [x] Repeat by creating/deleting another room quickly (same-minute timestamp edge case).
bhavishy2801 added 1 commit 2026-04-14 15:37:12 +00:00
bhavishy2801 added 1 commit 2026-04-14 15:38:02 +00:00
bhavishy2801 merged commit 132c7f031b into dev 2026-04-14 15:43:49 +00:00
Owner

Please don't merge your own PRs. This change doesn't actually change any behavior, because the semantics of max default undefined to 0. This issue is probably more related to synchronization; the bug described only happens sporadically.

Please don't merge your own PRs. This change doesn't actually change any behavior, because the semantics of `max` default `undefined` to 0. This issue is probably more related to synchronization; the bug described only happens sporadically.
hodlbod deleted branch fix-room-delete-partial-failure 2026-04-14 19:06:20 +00:00
Sign in to join this conversation.