@@ -2054,21 +2054,47 @@ The [=remote end steps=] with |session| and |command parameters| are:
2054
2054
2055
2055
1. Let |new subscriptions| to be a [=/list=] .
2056
2056
2057
+ 1. Let |match| be false.
2058
+
2057
2059
1. For each |subscription| of |session|'s [=subscriptions=] :
2058
2060
2061
+ 1. If |match| is true:
2062
+
2063
+ 1. [=list/append=] |subscription| to |new subscriptions|.
2064
+
2065
+ 1. [=Continue=] .
2066
+
2059
2067
1. If [=set/intersection=] of |subscription|'s [=subscription/event names=] and |event names| is an empty [=/set=] :
2060
2068
2061
2069
1. [=list/append=] |subscription| to |new subscriptions|.
2062
2070
2063
- 1. Continue.
2071
+ 1. [= Continue=] .
2064
2072
2065
2073
1. If |top-level traversable context ids| is an empty [=/set=] :
2066
2074
2067
- 1. [=list/Remove=] all items [=list/contains|contained=] in |event names| from | subscription|'s [=subscription/event names=] .
2075
+ 1. If | subscription|'s [=subscription/top-level traversable ids=] [=set/size=] is not zero:
2068
2076
2069
- 1. If |subscription|'s [=subscription/event names =] is not empty:
2077
+ 1. [=list/append =] |subscription| to |new subscriptions|.
2070
2078
2071
- 1. [=list/append=] |subscription| to |new subscriptions|.
2079
+ 1. [=Continue=] .
2080
+
2081
+ 1. Let |subscription event names| be [=set/clone=] of |subscription|'s [=subscription/event names=] .
2082
+
2083
+ 1. For each |event name| of |event names|:
2084
+
2085
+ 1. If |subscription event names| [=set/contains=] |event name|:
2086
+
2087
+ 1. [=list/Remove=] |event name| from |event names|.
2088
+
2089
+ 1. [=list/Remove=] |event name| from |subscription event names|.
2090
+
2091
+ 1. If |event names| [=set/size=] is zero, set |match| to true.
2092
+
2093
+ 1. If |subscription event names| is not empty:
2094
+
2095
+ 1. Set |subscription|'s [=subscription/event names=] to |subscription event names|.
2096
+
2097
+ 1. [=list/append=] |subscription| to |new subscriptions|.
2072
2098
2073
2099
1. Otherwise:
2074
2100
@@ -2086,18 +2112,29 @@ The [=remote end steps=] with |session| and |command parameters| are:
2086
2112
2087
2113
1. Set |event map|[|event name|] to [=set/clone=] of |subscription|'s [=subscription/top-level traversable ids=] .
2088
2114
2115
+ 1. Let |context ids to remove| be an empty [=/set=] .
2116
+
2089
2117
1. For each |event name| in |event names|:
2090
2118
2091
2119
1. If |event map|[|event name|] does not exist,
2092
- continue.
2120
+ [=continue=] .
2121
+
2122
+ 1. For each |top-level traversable id| of |top-level traversable context ids|:
2123
+
2124
+ 1. If |event map|[|event name|] [=set/contains=] |top-level traversable id|:
2093
2125
2094
- 1. Set |event map|[|event name|] to the [=set/difference=]
2095
- between |event map|[|event name|] and |top-level traversable context ids|.
2126
+ 1. [=list/Append=] |top-level traversable id| to |context ids to remove|.
2127
+
2128
+ 1. [=list/Remove=] |top-level traversable id| from |event map|[|event name|] .
2096
2129
2097
2130
1. If |event map|[|event name|] is an empty [=/set=] ,
2098
2131
2099
2132
1. [=map/Remove=] |event map|[|event name|] .
2100
2133
2134
+ 1. For each |top-level traversable id| of |context ids to remove|:
2135
+
2136
+ 1. [=list/Remove=] |top-level traversable id| from |top-level traversable context ids|.
2137
+
2101
2138
1. For each |event name| → |remaining top-level traversable ids| in |event map|:
2102
2139
2103
2140
1. Let |partial subscription| be a [=subscription=] with
@@ -2107,6 +2144,10 @@ The [=remote end steps=] with |session| and |command parameters| are:
2107
2144
2108
2145
1. [=list/append=] |partial subscription| to |new subscriptions|.
2109
2146
2147
+ 1. If |top-level traversable context ids| is empty, set |match| to true.
2148
+
2149
+ 1. If |match| is false, return [=error=] with [=error code=] [=invalid argument=] .
2150
+
2110
2151
1. Set |session|'s [=subscriptions=] to |new subscriptions|.
2111
2152
2112
2153
1. Otherwise:
0 commit comments