Compare commits

...

3 Commits

Author SHA1 Message Date
sakshamjain dcf332fbe4 Merge remote-tracking branch 'upstream/dev' into feat/space-invite-share 2026-04-14 23:24:17 +05:30
bhavishy2801 132c7f031b fix: remove deleted rooms from space navigation after refresh
## 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).
2026-04-14 15:43:49 +00:00
Prat_09 964ef441ec Update relay description (#195) (#197)
Co-authored-by: Pratyush Mohanty <prat_09@noreply.coracle.social>
Co-committed-by: Pratyush Mohanty <prat_09@noreply.coracle.social>
2026-04-14 15:09:46 +00:00
2 changed files with 10 additions and 4 deletions
+8 -2
View File
@@ -615,7 +615,12 @@ export const roomsByUrl = derived(roomMetaEventsByIdByUrl, roomMetaEventsByIdByU
for (const event of deleteEvents) {
for (const h of getTagValues("h", event.tags)) {
deletedByH.set(h, max([deletedByH.get(h), event.created_at]))
const deletedAt = deletedByH.get(h)
deletedByH.set(
h,
deletedAt === undefined ? event.created_at : max([deletedAt, event.created_at]),
)
}
}
@@ -623,8 +628,9 @@ export const roomsByUrl = derived(roomMetaEventsByIdByUrl, roomMetaEventsByIdByU
for (const event of metaEvents) {
const meta = tryCatch(() => readRoomMeta(event))
const deletedAt = meta ? deletedByH.get(meta.h) : undefined
if (!meta || gt(deletedByH.get(meta.h), meta.event.created_at)) {
if (!meta || (deletedAt !== undefined && !gt(meta.event.created_at, deletedAt))) {
continue
}
+2 -2
View File
@@ -58,14 +58,14 @@
<RelaySettingsItem
icon={Inbox}
title="Inbox Relays"
subtitle="Where you send your public notes. Be sure to select relays that will accept your notes, and which will let people who follow you read them."
subtitle="Where other people should send notes intended for you. Be sure to select relays that will accept notes that tag you."
relays={readRelayUrls}
addRelay={addReadRelay}
removeRelay={removeReadRelay} />
<RelaySettingsItem
icon={Plane}
title="Outbox Relays"
subtitle="Where other people should send notes intended for you. Be sure to select relays that will accept notes that tag you."
subtitle="Where you send your public notes. Be sure to select relays that will accept your notes, and which will let people who follow you read them."
relays={writeRelayUrls}
addRelay={addWriteRelay}
removeRelay={removeWriteRelay} />