Skip to content

3.x: Fix takeLast(time) last events time window calculation. #6648

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

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

akarnokd
Copy link
Member

The logic inside the Observable.takeLast(time) was not using a fixed timestamp to compare against but one that could change between calls, resulting in items wrongly skipped from the accumulated buffer. The PR makes this timestamp limit fixed outside the drain loop.

The Flowable variant did not have the issue but both received the unit test verifying the correct behavior.

The same fix for 2.x will be posted separately.

Fixes: #6647

@akarnokd akarnokd added this to the 3.0 milestone Sep 11, 2019
@codecov
Copy link

codecov bot commented Sep 11, 2019

Codecov Report

❗ No coverage uploaded for pull request base (3.x@9a36930). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##             3.x   #6648   +/-   ##
=====================================
  Coverage       ?   98.1%           
  Complexity     ?    6191           
=====================================
  Files          ?     678           
  Lines          ?   44722           
  Branches       ?    6176           
=====================================
  Hits           ?   43875           
  Misses         ?     295           
  Partials       ?     552
Impacted Files Coverage Δ Complexity Δ
.../operators/observable/ObservableTakeLastTimed.java 98.68% <100%> (ø) 2 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a36930...014c1be. Read the comment docs.

@akarnokd akarnokd merged commit 852e052 into ReactiveX:3.x Sep 12, 2019
@akarnokd akarnokd deleted the TakeLastWindowFix branch September 12, 2019 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.x: confused of method takeLast(long,TimeUnit)
2 participants