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

.buffer drops last buffer on source complete #2154

Closed
JaminFarr opened this issue Nov 23, 2016 · 3 comments
Closed

.buffer drops last buffer on source complete #2154

JaminFarr opened this issue Nov 23, 2016 · 3 comments
Labels
bug Confirmed bug

Comments

@JaminFarr
Copy link

RxJS version: 5.0.0-rc.4

Code to reproduce:

const tick = Observable.interval(100).take(15)

tick.buffer(Observable.interval(1000))
  .subscribe((x) => console.log(x))

Expected behavior:

[0, 1, 2, 3, 4, 5, 6, 7, 8]
[9, 10, 11, 12, 13, 14]

Actual behavior:

[0, 1, 2, 3, 4, 5, 6, 7, 8]

Additional information:
Operators .bufferTime, .bufferCount, .bufferWhen and .bufferToggle all immediately emit any open buffers when the source completes. Operator .buffer does not. The lose of values is unexpected.

I would expect the results of the following to be the same

source$.buffer(closer$)
  .subscribe((x) => console.log(x))


source$.window(closer$)
  .mergeMap(x => x.toArray())
  .subscribe((x) => console.log(x)) // Outputs expected behavior
@JaminFarr JaminFarr changed the title Buffer drops last buffer on source complete .buffer drops last buffer on source complete Nov 23, 2016
@JaminFarr
Copy link
Author

If this is confirmed as a bug I'd like to have a crack at fixing it

@kwonoj
Copy link
Member

kwonoj commented Jul 12, 2017

closed by #2174 .

@kwonoj kwonoj closed this as completed Jul 12, 2017
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants