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 Window by Count Unsubscribe Behavior #1829

Merged
merged 3 commits into from
Nov 6, 2014

Conversation

benjchristensen
Copy link
Member

This fixes #1546 where unsubscribes would occur prematurely for non-overlapping window(size) and would not unsubscribe at all for overlapping window(size, skip).

It also reorganizes the window unit tests which were all combined in one file when the implementations are split across 4 files. This is now easier to understand and use.

Split the unit tests up to match the implementation files.
Add unit tests for ReactiveX#1546 to OperatorWindowWithSizeTest
- ReactiveX#1546
- This also fixes the fact that the overlapping window overload was not propagating unsubscribe before. A new unit test caught that.
benjchristensen added a commit that referenced this pull request Nov 6, 2014
Fix Window by Count Unsubscribe Behavior
@benjchristensen benjchristensen merged commit 18d6f3e into ReactiveX:1.x Nov 6, 2014
@benjchristensen benjchristensen deleted the 1546-window branch November 6, 2014 06:07
@Override
public void call() {
// if no window we unsubscribe up otherwise wait until window ends
if(window == null) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure window has proper Thread visibility here.

Copy link
Member

Choose a reason for hiding this comment

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

It's better to mark parentSubscription final

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess over an observeOn on boundary this could become an issue (and if someone took a reference and put it in another thread and called it).

Copy link
Member Author

Choose a reason for hiding this comment

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

Here is a possible fix: #1833

My eyes are glazing over though so it may be completely wrong :-)

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.

3 participants