akiomik / akiomik/nosvelte

Hooks throw RxNostrAlreadyDisposedError after NostrApp is destroyed

Aberta
#80 0 comentários 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
TypeScript
Estrelas
29
Forks
3
Merge médio
3h 5min
PRs com merge (30d)
11

Descrição

`NostrApp` disposes its `rxNostr` on destroy
(`src/lib/components/NostrApp.svelte:38-40`) but never clears the module-level
`app` store, so the disposed instance stays published.

`useReq()`'s very first statement reads `rxNostr.getDefaultRelays()`
(`src/lib/stores/useReq.ts:25`), which throws `RxNostrAlreadyDisposedError` on a
disposed instance. Verified on `main` (609f8ed).

Any hook invocation after the provider is torn down is therefore an uncaught throw
rather than a graceful degradation. Reachable via a route change that leaves a
child mounted for a tick, an `{#if}` toggle around ``, or SSR where
`onDestroy` runs at the end of render.

## Direction

Clear the published instance on destroy, and have the hooks treat "no usable
rxNostr" as a state rather than letting the throw escape.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.