Closed chrishasz closed 5 years ago
Hi @chrishasz, Thanks! Got the point. Let me think what can I do. Going to refactor SPPull.ts as well.
@chrishasz applied the fix. Please check if it works for you. Published v2.4.0.
Hello @koltyakov!
Thanks for the quick response! I've upgraded to SPPull 2.4.0 and initial testing looks great. I'll run a few more tests in the morning just to make sure, but I'll close this issue now.
Thank you!
OK, so the title is a bit of a mouthful, but here is what I am experiencing:
When I use a RegEx pattern to filter downloads, and issue multiple simultaneous sppull requests, whichever RegEx pattern is specified for the last sppull request will be used across all requests. This is because the
options
object in the SPPull singleton is shared and last-in wins. There is actually a race condition across any property on theoptions
object, but thefileRegExp
object consistently fails, because the value is not accessed until after a roundtrip (or more) to the server.Would it be possible to export the
Download
class separately, separately from the singleton (for backwards compatibility) so that I can instantiate multiple instances of it, each with their own state?here is the code from
SPPull.js
which creates the singleton:Possibly related to this issue