Skip to content

Commit 9d2fe29

Browse files
authored
Remove unsubscrube by attributes feature (#998)
1 parent f1d6555 commit 9d2fe29

File tree

1 file changed

+13
-86
lines changed

1 file changed

+13
-86
lines changed

index.bs

Lines changed: 13 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,12 +1867,9 @@ remove event subscriptions identified by subscription IDs.
18671867

18681868
#### The session.UnsubscribeByAttributesRequest Type #### {#type-session-UnsubscribeByAttributesRequest}
18691869

1870-
Note: contexts param is deprecated and will be removed in the future versions.
1871-
18721870
<pre class="cddl" data-cddl-module="remote-cddl">
18731871
session.UnsubscribeByAttributesRequest = {
18741872
events: [+text],
1875-
? contexts: [+browsingContext.BrowsingContext],
18761873
}
18771874
</pre>
18781875

@@ -2180,9 +2177,6 @@ either globally or for a set of navigables.
21802177

21812178
Issue: This needs to be generalised to work with realms too.
21822179

2183-
Note: contexts parameter in UnsubscribeByAttributesRequest is deprecated
2184-
and will be removed in the future versions.
2185-
21862180
<dl>
21872181
<dt>Command Type</dt>
21882182
<dd>
@@ -2216,26 +2210,10 @@ The [=remote end steps=] with |session| and |command parameters| are:
22162210
let |event names| be the [=set/union=] of |event names| and the result of
22172211
[=trying=] to [=obtain a set of event names=] with |name|.
22182212

2219-
1. Let |top-level traversable context ids| be a [=/set=].
2220-
2221-
1. Let |input context ids| be [=set/create|create a set=] with |command parameters|[<code>contexts</code>].
2222-
2223-
1. If |input context ids| is not empty:
2224-
2225-
1. Let |navigables| be the result of [=trying=] to [=get valid navigables by ids=] with |input context ids|.
2226-
2227-
1. Set |top-level traversables| be [=get top-level traversables=] with |navigables|.
2228-
2229-
1. For each |navigable| in |top-level traversables|:
2230-
2231-
1. [=set/Append=] |navigable|'s [=navigable id=] to |top-level traversable context ids|.
2232-
22332213
1. Let |new subscriptions| to be a [=/list=].
22342214

22352215
1. Let |matched events| to be a [=/set=].
22362216

2237-
1. Let |matched contexts| to be a [=/set=].
2238-
22392217
1. For each |subscription| of |session|'s [=subscriptions=]:
22402218

22412219
1. If [=set/intersection=] of |subscription|'s [=subscription/event names=] and |event names| is an empty [=/set=]:
@@ -2244,83 +2222,32 @@ The [=remote end steps=] with |session| and |command parameters| are:
22442222

22452223
1. [=Continue=].
22462224

2247-
1. If |top-level traversable context ids| is an empty [=/set=]:
2248-
2249-
1. If |subscription| is not [=subscription/global=]:
2250-
2251-
1. [=list/append=] |subscription| to |new subscriptions|.
2252-
2253-
1. [=Continue=].
2254-
2255-
1. Let |subscription event names| be [=set/clone=] of |subscription|'s [=subscription/event names=].
2256-
2257-
1. For each |event name| of |event names|:
2258-
2259-
1. If |subscription event names| [=set/contains=] |event name|:
2260-
2261-
1. [=list/Append=] |event name| to |matched events|.
2225+
1. If |subscription| is not [=subscription/global=]:
22622226

2263-
1. [=list/Remove=] |event name| from |subscription event names|.
2264-
2265-
1. If |subscription event names| is not empty:
2266-
2267-
1. Let |cloned subscription| be a [=subscription=] with
2268-
[=subscription/subscription id=] set to |subscription|'s [=subscription/subscription id=],
2269-
[=subscription/event names=] set to a new [=/set=] containing |subscription event names|.
2270-
2271-
1. [=list/append=] |cloned subscription| to |new subscriptions|.
2272-
2273-
1. Otherwise:
2274-
2275-
1. If |subscription| is [=subscription/global=]:
2276-
2277-
1. [=list/append=] |subscription| to |new subscriptions|.
2278-
2279-
1. Otherwise, if |subscription|'s [=subscription/user context ids=] is not empty, [=continue=].
2280-
2281-
1. Otherwise:
2282-
2283-
Note: unsubscribe by contexts is deprecated and will be removed in the future versions.
2284-
2285-
1. Let |event map| be an empty [=/map=].
2286-
2287-
1. For each |event name| in |subscription|'s [=subscription/event names=]:
2288-
2289-
1. Set |event map|[|event name|] to [=set/clone=] of |subscription|'s [=subscription/top-level traversable ids=].
2290-
2291-
1. For each |event name| in |event names|:
2292-
2293-
1. If |event map|[|event name|] does not exist,
2294-
[=continue=].
2295-
2296-
1. For each |top-level traversable id| of |top-level traversable context ids|:
2227+
1. [=list/append=] |subscription| to |new subscriptions|.
22972228

2298-
1. If |event map|[|event name|] [=set/contains=] |top-level traversable id|:
2229+
1. [=Continue=].
22992230

2300-
1. [=list/Append=] |top-level traversable id| to |matched contexts|.
2231+
1. Let |subscription event names| be [=set/clone=] of |subscription|'s [=subscription/event names=].
23012232

2302-
1. [=list/Append=] |event name| to |matched events|.
2233+
1. For each |event name| of |event names|:
23032234

2304-
1. [=list/Remove=] |top-level traversable id| from |event map|[|event name|].
2235+
1. If |subscription event names| [=set/contains=] |event name|:
23052236

2306-
1. If |event map|[|event name|] is an empty [=/set=],
2237+
1. [=list/Append=] |event name| to |matched events|.
23072238

2308-
1. [=map/Remove=] |event map|[|event name|].
2239+
1. [=list/Remove=] |event name| from |subscription event names|.
23092240

2310-
1. For each |event name| → |remaining top-level traversable ids| in |event map|:
2241+
1. If |subscription event names| is not empty:
23112242

2312-
1. Let |partial subscription| be a [=subscription=] with
2313-
[=subscription/subscription id=] set to |subscription|'s [=subscription/subscription id=],
2314-
[=subscription/event names=] set to a new [=/set=] containing |event name|,
2315-
[=subscription/top-level traversable ids=] set to |remaining top-level traversable ids|.
2243+
1. Let |cloned subscription| be a [=subscription=] with
2244+
[=subscription/subscription id=] set to |subscription|'s [=subscription/subscription id=],
2245+
[=subscription/event names=] set to a new [=/set=] containing |subscription event names|.
23162246

2317-
1. [=list/append=] |partial subscription| to |new subscriptions|.
2247+
1. [=list/append=] |cloned subscription| to |new subscriptions|.
23182248

23192249
1. If |matched events| is not [=set/equal=] to |event names|, return [=error=] with [=error code=] [=invalid argument=].
23202250

2321-
1. If |top-level traversable context ids| is not empty and |matched contexts| is not [=set/equal=] to
2322-
|top-level traversable context ids|, return [=error=] with [=error code=] [=invalid argument=].
2323-
23242251
1. Set |session|'s [=subscriptions=] to |new subscriptions|.
23252252

23262253
1. Otherwise:

0 commit comments

Comments
 (0)