only render events after relay acceptance
Every Nostr write operation fired handleEvent/onSuccess on the first relay OK frame without checking msg[2] (the success boolean), so a rejection was treated as an acceptance. Rejected events appeared in the UI and vanished after refresh. Also fixes a data-loss risk in updateStoryWithKindChange where the original story could be deleted even if the replacement was rejected by all relays.
Adds publishWithAck in nostr-create.js — waits for msg[2] === true before calling success callbacks, and shows a toast with the relay's reason on all-rejections or timeout. sendMessage now returns its dispatch count so the helper knows how many OK frames to expect.
What this affects- send-message.js — returns relay dispatch count (non-breaking; existing callers ignore the return value)
- nostr-create.js — all write paths via create(): comments, reactions, RSVPs, stories, calendar events, profile, follows, bookmarks, file metadata, deletes
1. Log in and post a comment — it should appear and persist after refresh. 2. To test the failure path: post while disconnected from all relays — a toast should appear and nothing should render.
Updates · newest first
- preview ↗ fix: only render events after relay acceptance