Open Czino opened 1 month ago
In some cases, you don't even need to update the filters quickly. I suspect it depends whether eose
is reached or not
Thanks for this bug report. I guess a temporary fix would be using a cache like NDK-Cache-Dexie. (can you confirm?) But I will find a way to fix it permanently.
I tried to use @nostr-dev-kit/ndk-cache-dexie
as cache adapter, but the problem persists unfortunately
I found that if you switch fast enough between filters, the useSubscribe hook gets stuck on waiting for events. In other words
eose
is never true.I was able to reproduce it by quickly updating the url in the input field (e.g. move cursor to last position, quickly press delete and 3) It will then stay stuck on
Fetching messages...
https://codesandbox.io/p/sandbox/cldj6h?file=%2Fsrc%2FApp.js
Interestingly, if you set
{ closeOnEose: true }
, it behaves as expected. However, in my use case of developing a chat, I would like to not close the subscription.