core icon indicating copy to clipboard operation
core copied to clipboard

[Bugfix] Change awaitPromises/fromPromise not to emit events after disposed

Open gitusp opened this issue 4 years ago • 3 comments

Hi! It's been a while since I last made a little contribution to this project. I'm very surprised that this whole project migrated to TypeScript, which is great! 🎉


I found an edge case where awaitPromises/fromPromise unexpectedly emit events after disposed. The case may occur when you use switchLatest with slow resolving Promise.

I added a test case, which fails before this modification, and passes after this. I find managing disposed flag inside AwaitSink a bit awkward... but could not make it in another way, since Promise is not cancellable.


Anyway, thanks for maintaining this precious project. 🙏

gitusp avatar Jan 21 '21 13:01 gitusp

@briancavalier @TylorS Just a friendly reminder I wonder if the behavior of current implementation is intended or not. Could you give me a feedback at your earliest convenience?

gitusp avatar Mar 31 '21 09:03 gitusp

@Frikki Thanks for reviewing! I added comments on the test case.

gitusp avatar Apr 23 '21 03:04 gitusp

Hey @gitsup, sorry for the long delay! @Frikki and I were able to chat today, and we're in agreement that there's a bug here that you've fixed. We realized we need to maintain our dependencies more actively as there's unrelated errors in our test-latest test cases. We're probably going to disable it, get a few PRs through the pipeline (this one included), address our dependencies issue, re-enable the tests and then do a release.

TylorS avatar Apr 30 '21 17:04 TylorS