Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in issue #12
[email protected]introduced a memory leak by no longer aborting all requests – even those which successfully finished. This created a memory leak becausethis.abortControllersslowly filled up with theAbortControllerinstances of queries that finished successfully and were not aborted.I decided to not simply reintroduce the pre-1.5.7 code because the change was technically a breaking change: Previously, users could expect that the
'abort'event got always fired – no matter if the query got aborted or if it finished. Since passing a customabortControlleris part of the library’s API, the change in behavior created a breaking change for users. Of course, the change was accidental and the increased patch version number did not reflect the breaking change.Since most users are using
@1.6.0, I decided that the'abort'event shall only be sent if the query is actually aborted. This is in line with all versions from@1.5.7forward – keeping the behavior that most users expect nowadays. (And it makes logically more sense.) If you publish my changes then I recommend using version1.6.1.Unfortunately, I was not able to run the tests on my system. For some reasons all tests failed even without my changes. Could you do the quality assurance on your side since you know the dev env of your library much better than me?
I can at least say that with careful code review I made the code changes in a way that it is guaranteed that the
AbortControllerinstances are always removed fromthis.abortControllerswhile any impact on the existing logic is impossible by working withtry ... catchandtry ... finallyblocks.