You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixed
A request whose filters match no event no longer hangs. Such a REQ reaches
EOSE without the operator chain ever emitting, which left the underlying query
pending forever: status reported 'success' while data stayed undefined
indefinitely. The query now settles on completion, and data falls back to the
hook's initial value ([] for the list hooks, undefined for the single-event
ones) for the whole request rather than only before the first emission.
useUniqueEventList() now yields [] instead of undefined when no relays are
configured, matching the other list hooks and its own EventPacket[] return type. UniqueEventList was unaffected, but callers using the hook directly could hit a TypeError on the undefined the type said could not occur.
Cancelling a request now closes its REQ. A component unmounting before the relays
reach EOSE previously left the subscription — and the REQ on every relay in the
pool — open for the lifetime of the page.
error no longer survives the request that produced it. A retry or refetch that
succeeded still reported the previous attempt's failure, and because every
component checks its error slot first, a recovered request kept rendering the
error slot instead of its data. status now also reports 'error' when the
stream fails after the query has already resolved, which previously left status: 'success' sitting next to a set error.
Addressable events are now identified by their d tag wherever it appears in the
tag list, instead of assuming it is the first tag. useArticle()/Article returned
nothing at all for an article that led with any other tag (title, say), and useUserArticleList()/useUserReactionList() silently dropped events that happened
to share a leading tag value.
useMetadataList() and useUserArticleList() now replace an entry when a newer
version of the same event arrives, instead of appending it next to the version it
supersedes. Both could return several entries for one pubkey or one article.
useUserReactionList() no longer groups reactions as if they were addressable
events. Reactions are regular events, so keying them by an event coordinate
collapsed unrelated ones together — three reactions could come back as one. They
are now deduplicated by event id only.
Events delivered in the same batch as the first one are no longer dropped. They
reached the query cache before the request had settled and were then overwritten
by the value it settled with, so a relay flushing a backlog in one go could leave
a list holding only its first event.