Async dispatched config handlers#7344
Merged
benlesh merged 1 commit intoReactiveX:masterfrom Oct 27, 2023
Merged
Conversation
…ys async dispatch Resolves ReactiveX#7343
29982fd to
4a30be8
Compare
benlesh
commented
Sep 21, 2023
| const sharedSource = source.pipe(share({ resetOnComplete: () => reset, resetOnRefCountZero })); | ||
|
|
||
| const result = concat(sharedSource, firstPause, sharedSource); | ||
| it('should not call "resetOnRefCountZero" on error', () => { |
Member
Author
There was a problem hiding this comment.
Everything under this section is really a whitespace change. I'm not sure why the diff is flipping out here. This was just from reorganizing things in the file I think.
benlesh
commented
Sep 21, 2023
|
|
||
| it('should not reset on refCount 0 if reset notifier errors before emitting any value', () => { | ||
| spyOnUnhandledError((onUnhandledError) => { | ||
| describe('when config.onUnhandledError is set', () => { |
Member
Author
There was a problem hiding this comment.
Adding this describe block is what I think messed with the whitespace diff in other parts of the file.
benlesh
commented
Sep 21, 2023
| expectSubscriptions(source.subscriptions).toBe(sourceSubs); | ||
| }); | ||
|
|
||
| expect(onUnhandledError).to.have.been.calledOnce; |
Member
Author
There was a problem hiding this comment.
These tests were errant, in that they were able to check to see if onUnhandledError was dispatched synchronously, which it was never supposed to be.
benlesh
commented
Sep 22, 2023
| function handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) { | ||
| const { onStoppedNotification } = config; | ||
| onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber)); | ||
| onStoppedNotification && setTimeout(() => onStoppedNotification(notification, subscriber)); |
Member
Author
There was a problem hiding this comment.
One important bit is here.
benlesh
commented
Sep 22, 2023
| */ | ||
| export function reportUnhandledError(err: any) { | ||
| timeoutProvider.setTimeout(() => { | ||
| setTimeout(() => { |
Member
Author
There was a problem hiding this comment.
The other important bit is here.
jakovljevic-mladen
approved these changes
Oct 27, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is removing dependency on
timeoutProviderinObservablebecause observable depends onSubscriber, andSubscriberuserstimeoutProviderfor bothonUnhandledErrorandonStoppedNotification, when it doesn't really need to. That's not particularly whattimeoutProvideris for.This also preps us to publish
@rxjs/observableby limiting the dependencies thatObservablehas.Resolves #7343