-
Notifications
You must be signed in to change notification settings - Fork 3k
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(throttleTime): double emission with leading and trailing enabled #4727
fix(throttleTime): double emission with leading and trailing enabled #4727
Conversation
Pull Request Test Coverage Report for Build 8406
💛 - Coveralls |
I think you've already had a discussion about whether the behavior is intended in #2749. See #2749 (comment). That PR was closed by the author. Perhaps they didn't have the time. |
Test for double emission with leading and trailing enabled. Also add more tests for leading and trailing enabled. Double emission problem: source: a123b12-c-23d-2-ef--- expected: a---b---c---d---e---f actual: a---b1---c2---2-e---f
Fix an issue with throttleTime emitting both leading and trailing values in the same time window. Double emission problem: source: a123b12-c-23d-2-ef--- expected: a---b---c---d---e---f actual: a---b1---c2---2-e---f Closes ReactiveX#2466 and ReactiveX#2727. Follows ReactiveX#2749 and ReactiveX#2864. BREAKING CHANGE: throttleTime no longer emits both leading and trailing values in the same time window.
It was pointed out that the timings could be influenced due to slow user code, this has now been solved.
7dbbb96
to
1a3fe43
Compare
I've fixed the fact that slow user code could influence timings. I understand that time is finite and this PR might not be anywhere on the priority list but would a review be possible? I've also rebased the PR to be up-to-date. |
PR is definitely fixing unexpected behavior |
…least the throttled amount Works to align the behavior with expectations set by lodash's throttle - Updates tests - Ensures trailing throttle will wait to notify and then complete - Ensures that every time we emit a value a new throttle period starts fixes ReactiveX#3712 related ReactiveX#4864 fixes ReactiveX#2727 closes ReactiveX#4727 related ReactiveX#4429
…least the throttled amount Works to align the behavior with expectations set by lodash's throttle - Updates tests - Ensures trailing throttle will wait to notify and then complete - Ensures that every time we emit a value a new throttle period starts fixes ReactiveX#3712 related ReactiveX#4864 fixes ReactiveX#2727 closes ReactiveX#4727 related ReactiveX#4429
…least the throttled amount (#5687) * fix(throttleTime): ensure the spacing between throttles is always at least the throttled amount Works to align the behavior with expectations set by lodash's throttle - Updates tests - Ensures trailing throttle will wait to notify and then complete - Ensures that every time we emit a value a new throttle period starts fixes #3712 related #4864 fixes #2727 closes #4727 related #4429 * chore: Address comments and add comments to the code
This PR fixes an issue with throttleTime emitting both leading and trailing values in the same time window.
Double emission problem:
Closes #2466 and closes #2727.
Follows #2749 and #2864.