Repository navigation
Commit 88db838
committed
fix(client): await SSE stream open in connect() to prevent race condition
After sending notifications/initialized, await the GET SSE stream
opening so connect() does not resolve until the server can deliver
requests (e.g. roots/list) through it. Previously the stream was
opened fire-and-forget, meaning the server could attempt to send
before the client was listening.1 parent 3f15a76 commit 88db838
2 files changed
Lines changed: 6 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
296 | | - | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
| |||
554 | 552 | | |
555 | 553 | | |
556 | 554 | | |
557 | | - | |
558 | 555 | | |
559 | 556 | | |
560 | 557 | | |
561 | 558 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | 559 | | |
571 | 560 | | |
572 | 561 | | |
| |||
650 | 639 | | |
651 | 640 | | |
652 | 641 | | |
653 | | - | |
654 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
655 | 648 | | |
656 | 649 | | |
657 | 650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | 107 | | |
116 | 108 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 109 | | |
121 | 110 | | |
122 | 111 | | |
| |||
178 | 167 | | |
179 | 168 | | |
180 | 169 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 170 | | |
190 | 171 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | 172 | | |
195 | 173 | | |
196 | 174 | | |
| |||
230 | 208 | | |
231 | 209 | | |
232 | 210 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | 211 | | |
242 | 212 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | 213 | | |
247 | 214 | | |
248 | 215 | | |
| |||
0 commit comments