Fix deleted rooms persisting in navigation #285

Merged
hodlbod merged 1 commits from userAdityaa/flotilla:fix-room-delete-nav into dev 2026-05-29 15:20:22 +00:00
2 changed files with 7 additions and 3 deletions
+1
View File
@@ -122,6 +122,7 @@
repository.removeEvent(thunk.event.id)
pushToast({theme: "error", message})
} else {
await removeRoomMembership(url, h)
goto(makeSpacePath(url))
}
},
+6 -3
View File
@@ -5,7 +5,7 @@ import {derived, readable, writable} from "svelte/store"
import * as nip19 from "nostr-tools/nip19"
import {
on,
gt,
gte,
max,
spec,
call,
2
@@ -620,7 +620,7 @@ export const roomsByUrl = derived(roomMetaEventsByIdByUrl, roomMetaEventsByIdByU
for (const event of metaEvents) {
const meta = tryCatch(() => readRoomMeta(event))
Outdated
Review

this is unnecessary, deletes are already in roomMetaEventsByUrl right?

this is unnecessary, deletes are already in roomMetaEventsByUrl right?
Outdated
Review

It’s already there, but after deleting a room and refreshing, the deletion took a second to reflect.

so I did this to avoid the user noticing that delay even for a moment.
let me attach a video for it.

It’s already there, but after deleting a room and refreshing, the deletion took a second to reflect. so I did this to avoid the user noticing that delay even for a moment. let me attach a video for it.
Outdated
Review

I see, the roomMetaEventsByIdByUrl isn't populated until the event is accepted by the relay? This should be something taken care of by welshman's thunk — it populates both repository and tracker optimistically when publishing. I would debug why that's not working rather than add this band-aid.

I see, the roomMetaEventsByIdByUrl isn't populated until the event is accepted by the relay? This should be something taken care of by welshman's thunk — it populates both repository and tracker optimistically when publishing. I would debug why that's not working rather than add this band-aid.
Outdated
Review

please focus on caravel from your side for now since it’s the priority. I’ll dig into this issue a bit more from my end.

please focus on caravel from your side for now since it’s the priority. I’ll dig into this issue a bit more from my end.
if (!meta || gt(deletedByH.get(meta.h), meta.event.created_at)) {
if (!meta || gte(deletedByH.get(meta.h), meta.event.created_at)) {
continue
}
@@ -651,7 +651,10 @@ export const loadRoom = call(() => {
await load({
relays: [url],
filters: [{kinds: [ROOM_META], "#d": [h]}],
filters: [
{kinds: [ROOM_META], "#d": [h]},
{kinds: [ROOM_DELETE], "#h": [h]},
],
})
}
Outdated
Review

It looks like this is the only substantial change, does this fix it on its own?

It looks like this is the only substantial change, does this fix it on its own?
Outdated
Review

It looks like this is the only substantial change, does this fix it on its own?

It seems to be fixed now. Could you please confirm from your side as well?

> It looks like this is the only substantial change, does this fix it on its own? It seems to be fixed now. Could you please confirm from your side as well?