Commit 6a8a41d
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 a4416a9 commit 6a8a41d
2 files changed
Lines changed: 67 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
802 | | - | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
803 | 811 | | |
804 | 812 | | |
805 | 813 | | |
| |||
1147 | 1155 | | |
1148 | 1156 | | |
1149 | 1157 | | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1150 | 1165 | | |
1151 | 1166 | | |
1152 | 1167 | | |
1153 | 1168 | | |
1154 | 1169 | | |
1155 | 1170 | | |
1156 | | - | |
| 1171 | + | |
1157 | 1172 | | |
1158 | 1173 | | |
1159 | 1174 | | |
| |||
| 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