Commit 31b0490
committed
fix(client): guard listen() connectivity before park; auto-open failure surfaces via onerror
Two related hardening fixes:
- listen() now checks this.transport before any setup. _parkRequest throws
NotConnected synchronously, and it was called inside the ack-promise
executor AFTER the ack timer was armed — so a not-connected listen() leaked
a timer whose callback then dereferenced an unassigned park handle. The
guard returns the rejection as the listen() promise with no setup started.
- ClientOptions.listChanged auto-open during _connectNegotiated no longer
fails connect when listen() rejects (server refuses on capacity, does not
support listen, etc.). The modern connection is fully usable without a
listen stream; the failure surfaces via onerror and autoOpenedSubscription
stays undefined.
Tests added for both.1 parent 43e06e7 commit 31b0490
2 files changed
Lines changed: 67 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
853 | 861 | | |
854 | 862 | | |
855 | 863 | | |
| |||
1210 | 1218 | | |
1211 | 1219 | | |
1212 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
1213 | 1228 | | |
1214 | 1229 | | |
1215 | 1230 | | |
1216 | 1231 | | |
1217 | 1232 | | |
1218 | 1233 | | |
1219 | | - | |
| 1234 | + | |
1220 | 1235 | | |
1221 | 1236 | | |
1222 | 1237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
169 | 182 | | |
170 | 183 | | |
171 | 184 | | |
| |||
181 | 194 | | |
182 | 195 | | |
183 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
184 | 234 | | |
0 commit comments