-
Notifications
You must be signed in to change notification settings - Fork 16
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 Observable unsubscription timing #120
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
benlesh
approved these changes
Feb 21, 2024
github-actions bot
added a commit
that referenced
this pull request
Feb 21, 2024
SHA: 0a417ad Reason: push, by domfarolino Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Feb 21, 2024
This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Feb 21, 2024
This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
Feb 21, 2024
This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5311097 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1263562}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Feb 21, 2024
This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5311097 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1263562}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Feb 21, 2024
This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5311097 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1263562}
marcoscaceres
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Feb 23, 2024
This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5311097 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1263562}
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Feb 28, 2024
…s, a=testonly Automatic update from web-platform-tests DOM: Reorder Observable completion events This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5311097 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1263562} -- wpt-commits: a1a5ea2b3dc460ce75cbfcf237538d959469b1ed wpt-pr: 44682
ErichDonGubler
pushed a commit
to erichdongubler-mozilla/firefox
that referenced
this pull request
Feb 28, 2024
…s, a=testonly Automatic update from web-platform-tests DOM: Reorder Observable completion events This CL "fixes" Observable unsubscription/teardown timing. As a matter of accidental historical precedent, Observables in JavaScript (but not in other languages) had implemented the "rule" that upon Subscriber#error() or Subscriber#complete(), the subscriber would: 1. First, invoke the appropriate Observer callback, if provided (i.e., complete() or error() callback). 2. Signal abort Subscriber#signal, which invokes any teardowns and also fires the `abort` event at the signal. However, after dom@chromium.org discussed this more with ben@benlesh.com, we came to the conclusion that the principle of "as soon as you know you will teardown, you MUST close the subscription and any upstream subscriptions" should be adhered. This means the above steps must be inverted. This is a small-in-size but medium-in-impact design change for the Observable concept, and led to a blog post [1] and an announcement [2] that the RxJS library intends to change its historical ordering of these events. This CL: 1. Inverts the order of the aforementioned steps in the Blink implementation. 2. Improves some tests that assert this new ordering. 3. Simplifies the takeUntil() operator in general. The Observable spec will be updated alongside this commit: WICG/observable#120. [1]: https://benlesh.com/posts/observables-are-broken-and-so-is-javascript/ [2]: ReactiveX/rxjs#7443 R=masonf@chromium.org Bug: 1485981 Change-Id: I376e66eef490808d264dc999862a801d591aa278 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5311097 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1263562} -- wpt-commits: a1a5ea2b3dc460ce75cbfcf237538d959469b1ed wpt-pr: 44682
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR "fixes" Observable unsubscription/teardown timing. As a matter
of accidental historical precedent, Observables in JavaScript (but not
in other languages) had implemented the "rule" that upon
Subscriber#error() or Subscriber#complete(), the subscriber would:
complete() or error() callback).
fires the
abort
event at the signal.However, after dom@chromium.org discussed this more with
ben@benlesh.com, we came to the conclusion that the principle of "as
soon as you know you will teardown, you MUST close the subscription and
any upstream subscriptions" should be followed. This means the above
steps must be inverted. This is a small-in-size but medium-in-impact
design change for the Observable concept, and led to a blog post and
an announcement that the RxJS library intends to change its
historical ordering of these events.
This PR is made alongside https://crrev.com/c/5311097 and web-platform-tests/wpt#44682, which fixes the Chromium implementation and test expectations respectively.
Preview | Diff