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

Add the step to check subscriber's active state to next(value)/error(error)/complete() as a shortcut #129

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tetsuharuohzeki
Copy link

@tetsuharuohzeki tetsuharuohzeki commented Mar 26, 2024

Fix #114


Preview | Diff

@domfarolino
Copy link
Collaborator

spec.bs Outdated
@@ -210,6 +212,8 @@ The <dfn attribute for=Subscriber><code>signal</code></dfn> getter steps are to
<div algorithm>
The <dfn for=Subscriber method><code>error(|error|)</code></dfn> method steps are:

1. If [=this=]'s [=Subscriber/active=] is false, then return.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, but there's an additional step. If the Subscriber/active is false, we'll want to report the |error| with reportError, because it can't be handled and we don't want it to be completely swallowed or ignored. cc @domfarolino

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's currently complicated in this PR because #129 has not been addressed yet. If we address #129, then we can use the active variable as the sole signal for whether we should proceed or not, instead of sometimes use active and sometime use "algorithm nullness".

@benlesh
Copy link
Collaborator

benlesh commented Apr 10, 2024

I'm not quite sure how the build is failing, maybe @domfarolino needs to look at it, or maybe it just needs rebased... however, it seems that @tetsuharuohzeki you'll need to link your account to a W3C account to pass on of the checks above.
image

@domfarolino
Copy link
Collaborator

@benlesh I think your commit touched the wrong method next() instead of error(). Please revert/fix.

@benlesh
Copy link
Collaborator

benlesh commented Apr 10, 2024

@domfarolino oops, fixed.

@tetsuharuohzeki
Copy link
Author

however, it seems that @tetsuharuohzeki you'll need to link your account to a W3C account to pass on of the checks above.

#129 (comment)

@benlesh

I resolved that a moment ago.


Do you think we can make this simplification go a bit further by making wicg.github.io/observable/#subscriber-next-algorithm, wicg.github.io/observable/#subscriber-error-algorithm, and wicg.github.io/observable/#subscriber-complete-algorithm all non-null, and then not clearing them in wicg.github.io/observable/#close-a-subscription?

#129 (comment)

@domfarolino

I would like to have a time to answer it to switch my brain to this spec :)
And I think it might be better to talk about it as the new issue.

@domfarolino
Copy link
Collaborator

And I think it might be better to talk about it as the new issue.

I think you are proposing to do this in a separate issue/follow-up, but I think this should be done in this PR. It is a simple change that is very inline with the changes this PR makes. I view the changes I've requested as a way to "finish up" the work started here, which would be great to do here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants