Queue outgoing events when relay connection is down #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When the relay connection is temporarily lost, nostrclient drops any events published during the disconnection window. Extensions (nostrmarket, events) publish via nostrclient's internal WebSocket, which queues the
["EVENT", ...]message — but nostrclient's relay connection may be down at that moment, and the event is silently lost.Observed: events extension published a NIP-52 calendar event at 17:21:58, but the nostrclient relay connection was lost at 17:18:43 and didn't reconnect until 17:22:53. The event never reached the relay.
Expected behavior
Outgoing EVENT messages should be queued and retried when the relay reconnects, not dropped.
Proposed solution
relay.send()fails or relay is disconnected, queue the eventImpact
This affects all extensions that publish via nostrclient:
Workaround
Currently, extensions can re-publish events manually (e.g., re-approve an event). But this isn't automatic.