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

Return "no such user context" and "no such frame" instead "invalid argument" in "session.subscribe" and "session.unsubscribe" #865

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,22 @@ To <dfn>get top-level traversables</dfn> given a [=/list=] of [=/navigables=] |n

</div>

<div algorithm>

To <dfn>get valid navigables by ids</dfn> given a [=/list=] of context ids |navigable ids|:

1. Let |result| be an empty [=/set=].

1. For each |navigable id| in |navigable ids|:

1. Let |navigable| be the result of [=trying=] to [=get a navigable=] with |navigable id|.

1. [=set/Append=] |navigable| to |result|.

1. Return [=success=] with data |result|.

</div>

<div algorithm> To <dfn export>emit an event</dfn> given |session|, and |body|:

1. [=Assert=]: |body| has [=map/size=] 2 and [=map/contains=] "<code>method</code>"
Expand Down Expand Up @@ -1982,11 +1998,7 @@ The [=remote end steps=] with |session| and |command parameters| are:

1. If |input context ids| is not empty:

1. Let |navigables| be [=get navigables by ids=] with |input context ids|.

1. If [=list/size=] of |navigables| does not equal [=list/size=] of |input context ids|:

1. Return [=error=] with [=error code=] [=invalid argument=].
1. Let |navigables| be the result of [=trying=] to [=get valid navigables by ids=] with |input context ids|.

1. Set |subscription navigables| be [=get top-level traversables=] with |navigables|.

Expand All @@ -2000,7 +2012,7 @@ The [=remote end steps=] with |session| and |command parameters| are:

1. Let |user context| be [=get user context=] with |user context id|.

1. If |user context| is null, return [=error=] with [=error code=] [=invalid argument=].
1. If |user context| is null, return [=error=] with [=error code=] [=no such user context=].

1. [=list/For each=] |top-level traversable| in the list of all [=/top-level traversables=]
whose [=associated user context=] is |user context|:
Expand Down Expand Up @@ -2102,11 +2114,7 @@ The [=remote end steps=] with |session| and |command parameters| are:

1. If |input context ids| is not empty:

1. Let |navigables| be [=get navigables by ids=] with |input context ids|.

1. If [=list/size=] of |navigables| does not equal [=list/size=] of |input context ids|:

1. Return [=error=] with [=error code=] [=invalid argument=].
1. Let |navigables| be the result of [=trying=] to [=get valid navigables by ids=] with |input context ids|.

1. Set |top-level traversables| be [=get top-level traversables=] with |navigables|.

Expand Down