core
core copied to clipboard
[Bugfix] Change awaitPromises/fromPromise not to emit events after disposed
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. 🙏
@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?
@Frikki Thanks for reviewing! I added comments on the test case.
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.