Stop a silent relay holding up the save path #1
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/save-latency"
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?
Saving a bookmark into a list stalled for 12 seconds after the user had already approved the signature in Amber.
syncListMembershipre-reads the user's lists before editing them — correct, it's a read-modify-write on a replaceable event. But it took the complete-answer branch offetchMapped, which waits for the slowest relay.relay.nostr.bandis inDEFAULT_RELAYSand never sends EOSE for these queries (measured 2026-08-05: a kind-39701 REQ returned 0 events and never EOSEd), so every list re-read paid the fullFETCH_TIMEOUT.Measured on-device by the new test, against unfixed code:
The fix
The complete-answer path now streams and stops once relays go quiet — 3s for the first event, 1.2s of quiet after each — the same shape
fetchFollowsalready uses for the identical problem (reported by laoc 2026-08-04). A healthy set answers in 250-350ms and the stream ends by itself when every relay has sent EOSE; the windows only ever cut off a straggler.The trade is deliberate: a relay lagging more than
SETTLE_QUIET_MSbehind its peers no longer contributes to the version we edit from.FETCH_TIMEOUTwas never a completeness guarantee either, only a longer bound.This also fixes the same stall in
editList(:1493), the other read-modify-write path.Testing
SilentRelayE2ETest, backed byscripts/never-eose-relay.py— a relay that completes the websocket upgrade, so rust-nostr counts it as live with an open subscription, and then answers nothing. A closed port would not do: that's refused in ~115ms and exercises a different branch.Note on a number I got wrong
I first reported this stall as ~7s, reading nak's 7122/7131ms as a fixed server-side delay. It isn't — that's nak's own client timeout, proven by the stand-in relay (which sends nothing at all) producing the identical 7119ms. The app's bound is 12s, so the real stall was worse than I described.
Not merged yet
0.11.0 is mid-release from
mainat668be3dand the signed APK under test was built there, so I've left this for you to merge when that's settled.