Commit b016174
authored
Fixes an `EventSource.start()` re-entrancy problem
When:
1. `EventSource.start()` is called
2. `EventSource.start()` is called again, before the network response
from the first call has been received
Then:
- a second `URLSession` and `URLRequest` are created, and a new
`URLSessionDataTask` is started
The underlying issue is that `start()` is checking for `readyState` ==
`.raw`, but `readyState` isn't set until a network response has been
received.
1 parent 30c93bd commit b016174
File tree
2 files changed
+12
-0
lines changed- Source
- Tests
2 files changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
210 | 221 | | |
211 | 222 | | |
212 | 223 | | |
| |||
0 commit comments