Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't treat notifier completion as a signal #5853

Merged
merged 7 commits into from
Nov 3, 2020

Conversation

cartant
Copy link
Collaborator

@cartant cartant commented Oct 25, 2020

Description:

This PR changes the behaviour of audit, bufferToggle, bufferWhen, debounce, sample, throttle and windowToggle so the that the complete notifications received from notifier/duration-selector observables are no longer treated as signals.

BREAKING CHANGES: the behaviour of the above-mentioned operators has changed for empty notifiers/selectors.

Related issue (if exists): #5838

@cartant cartant marked this pull request as ready for review October 27, 2020 01:22
@cartant cartant requested a review from benlesh October 27, 2020 01:22
@cartant cartant changed the title WIP fix: don't treat notifier completion as a signal fix: don't treat notifier completion as a signal Oct 27, 2020
@cartant cartant mentioned this pull request Oct 27, 2020
13 tasks
Copy link
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. This looks great.

The only thing I'd really like you to do @cartant is to clean up the commits, flattening out the "chore" type commits and breaking it into just the relevant fixes, such that each fix with a breaking change has a BREAKING CHANGE: ... comment in the commit message. Then just rebase and merge here on GitHub.

This way, the breaking changes will show up in the CHANGELOG when I generate it at release time. These are fixes, but they are liable to break someone I imagine.

BREAKING CHANGE: the observable returned by the audit operator's duration selector must emit a next notification to end the duration. Complete notifications no longer end the duration.
BREAKING CHANGE: the sample operator's notifier observable must emit a next notification to effect a sample. Complete notifications no longer effect a sample.
BREAKING CHANGE: the observable returned by the throttle operator's
duration selector must emit a next notification to end the duration.
Complete notifications no longer end the duration.
BREAKING CHANGE: the observable returned by the debounce operator's
duration selector must emit a next notification to end the duration.
Complete notifications no longer end the duration.
BREAKING CHANGE: the observable returned by the bufferWhen operator's
closing selector must emit a next notification to close the buffer.
Complete notifications no longer close the buffer.
@cartant
Copy link
Collaborator Author

cartant commented Oct 31, 2020

@benlesh Done. I updated the docs, too. I'd missed those and they mentioned complete notifications.

@cartant
Copy link
Collaborator Author

cartant commented Oct 31, 2020

@benlesh I'm not sure about the change I made to bufferToggle. If the closing notifier completes, the buffer is discarded. I don't know whether it should do that or should keep the buffer open - accumulating values - to be emitted when/if the source completes. That's what happens with windowToggle - unclosed windows stay open until the source completes. What do you think should happen?

P.S. The two commits that precede this were just some changes to the marble diagram alignments in bufferToggle. I haven't made any changes to the implementations since this was reviewed.

@benlesh
Copy link
Member

benlesh commented Nov 2, 2020

@cartant bufferX should always be the same as windowX with a toArray... windowX(), mergeMap(toArray()) basically.

BREAKING CHANGE: the observable returned by the bufferToggle operator's
closing selector must emit a next notification to close the buffer.
Complete notifications no longer close the buffer.
BREAKING CHANGE: the observable returned by the windowToggle operator's
closing selector must emit a next notification to close the window.
Complete notifications no longer close the window.

Closes ReactiveX#5838
@cartant
Copy link
Collaborator Author

cartant commented Nov 2, 2020

@benlesh Done.

@benlesh benlesh merged commit 9cb56c4 into ReactiveX:master Nov 3, 2020
@benlesh
Copy link
Member

benlesh commented Nov 3, 2020

Nice. Thanks!

@cartant cartant deleted the issue-5838 branch November 6, 2020 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants