@@ -2054,15 +2054,11 @@ 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 .
2057
+ 1. Let |matched events| to be a [=/set=] .
2058
2058
2059
- 1. For each |subscription| of |session|'s [=subscriptions=] :
2060
-
2061
- 1. If |match| is true:
2062
-
2063
- 1. [=list/append=] |subscription| to |new subscriptions|.
2059
+ 1. Let |matched contexts| to be a [=/set=] .
2064
2060
2065
- 1. [=Continue=] .
2061
+ 1. For each |subscription| of |session|'s [=subscriptions=] :
2066
2062
2067
2063
1. If [=set/intersection=] of |subscription|'s [=subscription/event names=] and |event names| is an empty [=/set=] :
2068
2064
@@ -2072,7 +2068,7 @@ The [=remote end steps=] with |session| and |command parameters| are:
2072
2068
2073
2069
1. If |top-level traversable context ids| is an empty [=/set=] :
2074
2070
2075
- 1. If |subscription|'s [=subscription/top-level traversable ids=] [=set/size=] is not zero :
2071
+ 1. If |subscription| is not [=subscription/global=] :
2076
2072
2077
2073
1. [=list/append=] |subscription| to |new subscriptions|.
2078
2074
@@ -2084,17 +2080,17 @@ The [=remote end steps=] with |session| and |command parameters| are:
2084
2080
2085
2081
1. If |subscription event names| [=set/contains=] |event name|:
2086
2082
2087
- 1. [=list/Remove =] |event name| from |event names |.
2083
+ 1. [=list/Append =] |event name| to |matched events |.
2088
2084
2089
2085
1. [=list/Remove=] |event name| from |subscription event names|.
2090
2086
2091
- 1. If |event names| [=set/size=] is zero, set |match| to true.
2092
-
2093
2087
1. If |subscription event names| is not empty:
2094
2088
2095
- 1. Set |subscription|'s [=subscription/event names=] to |subscription event names|.
2089
+ 1. Let |cloned subscription| be a [=subscription=] with
2090
+ [=subscription/subscription id=] set to |subscription|'s [=subscription/subscription id=] ,
2091
+ [=subscription/event names=] set to a new [=/set=] containing |subscription event names|.
2096
2092
2097
- 1. [=list/append=] |subscription| to |new subscriptions|.
2093
+ 1. [=list/append=] |cloned subscription| to |new subscriptions|.
2098
2094
2099
2095
1. Otherwise:
2100
2096
@@ -2106,21 +2102,12 @@ The [=remote end steps=] with |session| and |command parameters| are:
2106
2102
2107
2103
Note: unsubscribe by contexts is deprecated and will be removed in the future versions.
2108
2104
2109
- 1. If [=set/intersection=] of |event names| and |subscription|'s [=subscription/event names=]|' s [=set/size=]
2110
- does not equal |event names|'s [=set/size=] :
2111
-
2112
- 1. [=list/append=] |subscription| to |new subscriptions|.
2113
-
2114
- 1. [=Continue=] .
2115
-
2116
2105
1. Let |event map| be an empty [=/map=] .
2117
2106
2118
2107
1. For each |event name| in |subscription|'s [=subscription/event names=] :
2119
2108
2120
2109
1. Set |event map|[|event name|] to [=set/clone=] of |subscription|'s [=subscription/top-level traversable ids=] .
2121
2110
2122
- 1. Let |context ids to remove| be an empty [=/set=] .
2123
-
2124
2111
1. For each |event name| in |event names|:
2125
2112
2126
2113
1. If |event map|[|event name|] does not exist,
@@ -2130,18 +2117,16 @@ The [=remote end steps=] with |session| and |command parameters| are:
2130
2117
2131
2118
1. If |event map|[|event name|] [=set/contains=] |top-level traversable id|:
2132
2119
2133
- 1. [=list/Append=] |top-level traversable id| to |context ids to remove|.
2120
+ 1. [=list/Append=] |top-level traversable id| to |matched contexts|.
2121
+
2122
+ 1. [=list/Append=] |event name| to |matched events|.
2134
2123
2135
2124
1. [=list/Remove=] |top-level traversable id| from |event map|[|event name|] .
2136
2125
2137
2126
1. If |event map|[|event name|] is an empty [=/set=] ,
2138
2127
2139
2128
1. [=map/Remove=] |event map|[|event name|] .
2140
2129
2141
- 1. For each |top-level traversable id| of |context ids to remove|:
2142
-
2143
- 1. [=list/Remove=] |top-level traversable id| from |top-level traversable context ids|.
2144
-
2145
2130
1. For each |event name| → |remaining top-level traversable ids| in |event map|:
2146
2131
2147
2132
1. Let |partial subscription| be a [=subscription=] with
@@ -2151,9 +2136,10 @@ The [=remote end steps=] with |session| and |command parameters| are:
2151
2136
2152
2137
1. [=list/append=] |partial subscription| to |new subscriptions|.
2153
2138
2154
- 1. If |top-level traversable context ids| is empty, set |match| to true .
2139
+ 1. If |matched events| does not equal |event names|, return [=error=] with [=error code=] [=invalid argument=] .
2155
2140
2156
- 1. If |match| is false, return [=error=] with [=error code=] [=invalid argument=] .
2141
+ 1. If |top-level traversable context ids| is not empty and |matched contexts| does not equal
2142
+ |top-level traversable context ids|, return [=error=] with [=error code=] [=invalid argument=] .
2157
2143
2158
2144
1. Set |session|'s [=subscriptions=] to |new subscriptions|.
2159
2145
0 commit comments