Commit 74fee72
fix(relay): replace active stall probe with passive inbound watchdog
The previous stall watchdog issued a periodic NIP-01 REQ ("are you
still there?") and treated a missing EOSE as a stalled socket. That
write is the trigger for a much worse failure on Warp / VPN-asleep
half-open sockets: the tauri-plugin-websocket `send` command holds
the global connection-manager mutex across the underlying
`poll_flush`, so a probe parked on a dead socket blocks every
subsequent `connect` from registering its writer in the map. The
replacement socket's read loop never starts → no AUTH challenge ever
reaches JS → 8s AUTH timeout → reset → repeat forever. We've
reproduced this as the WARP wedge.
Remove the active probe entirely. Track inbound activity instead:
`recordInbound()` is called from `handleWsMessage` for every frame
(including relay heartbeat pings, which are observable as Channel
messages even when not surfaced as nostr-protocol payloads). After
60s with no inbound frame at all we declare a stall and call back
into the client, which tears down the socket so the existing
reconnect path runs. The watchdog itself performs zero writes,
which means it cannot trigger the plugin wedge it's trying to
detect.
A deterministic Playwright regression in
`desktop/tests/e2e/relay-reconnect.spec.ts` simulates the plugin
symptom directly by hanging `plugin:websocket|send` in the e2e
bridge and verifies the watchdog does not write into the half-open
socket while reconnect proceeds.
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>1 parent 8033bd0 commit 74fee72
7 files changed
Lines changed: 167 additions & 183 deletions
File tree
- desktop
- src
- testing
- tests
- e2e
- helpers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 38 | + | |
| 39 | + | |
52 | 40 | | |
53 | | - | |
54 | | - | |
| 41 | + | |
| 42 | + | |
55 | 43 | | |
56 | 44 | | |
57 | 45 | | |
| |||
90 | 78 | | |
91 | 79 | | |
92 | 80 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 81 | + | |
| 82 | + | |
96 | 83 | | |
97 | 84 | | |
98 | 85 | | |
| |||
692 | 679 | | |
693 | 680 | | |
694 | 681 | | |
| 682 | + | |
695 | 683 | | |
696 | 684 | | |
697 | 685 | | |
| |||
813 | 801 | | |
814 | 802 | | |
815 | 803 | | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | 804 | | |
823 | 805 | | |
824 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
22 | 19 | | |
| 20 | + | |
23 | 21 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 22 | + | |
| 23 | + | |
31 | 24 | | |
32 | 25 | | |
33 | 26 | | |
34 | | - | |
| 27 | + | |
35 | 28 | | |
36 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
40 | | - | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | | - | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
55 | | - | |
| 52 | + | |
| 53 | + | |
56 | 54 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 55 | + | |
| 56 | + | |
63 | 57 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 58 | + | |
| 59 | + | |
71 | 60 | | |
72 | 61 | | |
73 | | - | |
74 | | - | |
| 62 | + | |
| 63 | + | |
75 | 64 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
79 | 76 | | |
80 | | - | |
81 | | - | |
| 77 | + | |
82 | 78 | | |
83 | 79 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
95 | 86 | | |
96 | 87 | | |
97 | | - | |
98 | | - | |
| 88 | + | |
| 89 | + | |
99 | 90 | | |
100 | | - | |
101 | | - | |
102 | 91 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
106 | 95 | | |
107 | 96 | | |
108 | 97 | | |
109 | | - | |
| 98 | + | |
110 | 99 | | |
111 | 100 | | |
112 | 101 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 102 | + | |
| 103 | + | |
120 | 104 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 105 | + | |
125 | 106 | | |
0 commit comments