Skip to content

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.

Fixes: #6647

@codecov
Copy link

codecov bot commented Sep 12, 2019

Codecov Report

Merging #6653 into 2.x will decrease coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6653      +/-   ##
============================================
- Coverage     98.24%   98.18%   -0.07%     
- Complexity     6344     6345       +1     
============================================
  Files           677      677              
  Lines         45550    45551       +1     
  Branches       6332     6332              
============================================
- Hits          44752    44724      -28     
- Misses          248      262      +14     
- Partials        550      565      +15
Impacted Files Coverage Δ Complexity Δ
.../operators/observable/ObservableTakeLastTimed.java 98.68% <100%> (+0.01%) 2 <0> (ø) ⬇️
...ernal/operators/flowable/FlowableFlatMapMaybe.java 91.3% <0%> (-5.32%) 2% <0%> (ø)
.../operators/observable/ObservableFlatMapSingle.java 90.29% <0%> (-5.23%) 2% <0%> (ø)
...nternal/operators/parallel/ParallelReduceFull.java 91.08% <0%> (-3.97%) 2% <0%> (ø)
...ternal/operators/observable/ObservablePublish.java 96.49% <0%> (-3.51%) 12% <0%> (ø)
...ava/io/reactivex/processors/BehaviorProcessor.java 95.96% <0%> (-3.14%) 59% <0%> (-1%)
...perators/single/SingleFlatMapIterableFlowable.java 95.83% <0%> (-2.5%) 2% <0%> (ø)
...nternal/operators/observable/ObservableWindow.java 98% <0%> (-2%) 3% <0%> (ø)
...activex/internal/schedulers/ScheduledRunnable.java 98.07% <0%> (-1.93%) 29% <0%> (-1%)
...tivex/internal/operators/single/SingleTimeout.java 98.33% <0%> (-1.67%) 2% <0%> (ø)
... and 17 more

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 cc690ff...7c8da70. Read the comment docs.

@akarnokd akarnokd merged commit 71bfcae into ReactiveX:2.x Sep 13, 2019
@akarnokd akarnokd deleted the TakeLastTime2x branch September 13, 2019 15:50
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 participants