FIX wrong success for an erronous fetch, after an abort of a legit fetch#22
FIX wrong success for an erronous fetch, after an abort of a legit fetch#22basos9 wants to merge 2 commits intojaubourg:masterfrom
Conversation
Conflicts: test/unit.js
This bug can be manifested when a pending fetch of a legit resource (200 response) is aborted and afterwards a new fetch that leads to error (e.g. 404) is issued. At the time, the second request finishes the lastValue has the aborted data of the previous fetch (callback is executed even on aborted), YIELDING the second (normally erroneus response) to be signaled as successfull.
|
Isn't this due to the fact browsers won't stop the execution of a script when the script tag is removed from the DOM? |
|
Yes, this seems to be the basic cause. Of course this applies when the callback name is the same across requests. If it is random the odds decrease. |
This bug can be manifested when a pending fetch of a legit resource (200 response)
is aborted and afterwards a new fetch that leads to error (e.g. 404) is issued.
At the time, the second request finishes the lastValue has the aborted data of
the previous fetch (callback is executed even on aborted), YIELDING the second (normally
erroneus response) to be signaled as successfull.
The effect of this bug is demonstrated with a test,
One can remove the jsonp patch and see what happens.