Repository navigation
Commit db783db
committed
fix(realtime): believe a refusal only once a fresh token has been refused too
"Access ended" is terminal for the hook's lifetime, so it was being reached
by three things that are not the end of anyone's access.
A realtime token lives at most 60 seconds. A backgrounded tab has its timers
throttled and can be frozen outright, so the gap between minting one and
opening the stream with it can outlast it, and the 401 that answers is about
the token rather than the person. A 404 is what an edge answers while the
realtime service is being replaced: no route right now, not "not your site".
And access_revoked is the control frame sent whenever an epoch moves, which
a member removal, a share-settings change, a deletion start and the worker
replaying any of those from its outbox all do. The hub's own comment spells
out the client's part of that contract, "stop, re-mint, and find out why
from the API", and calls over-bumping safe precisely because of it.
So each of those now costs one more round trip with a new token, and only
the second refusal is believed. A 403 still is believed at once: the gateway
read the token and answered about the person. The allowance resets on every
stream that opens, so it is one per healthy connection, not one per page.
The status also moves into the card's header, where the live count already
sits. A caveat about every number in the card belongs beside the card's name
rather than in a strip over the rows, and a live count printed next to a
stream that is not live is the one thing that header must never say.1 parent 6925187 commit db783db
2 files changed
Lines changed: 102 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
152 | 163 | | |
153 | 164 | | |
154 | | - | |
| 165 | + | |
155 | 166 | | |
156 | 167 | | |
157 | 168 | | |
| |||
181 | 192 | | |
182 | 193 | | |
183 | 194 | | |
184 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
185 | 198 | | |
186 | | - | |
187 | | - | |
| 199 | + | |
188 | 200 | | |
189 | 201 | | |
190 | 202 | | |
191 | 203 | | |
192 | 204 | | |
193 | 205 | | |
194 | 206 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
34 | 54 | | |
35 | 55 | | |
36 | 56 | | |
| |||
68 | 88 | | |
69 | 89 | | |
70 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
71 | 97 | | |
72 | 98 | | |
73 | 99 | | |
| |||
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
88 | 115 | | |
89 | 116 | | |
90 | 117 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
94 | 129 | | |
95 | | - | |
96 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
97 | 133 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
111 | 166 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
117 | 171 | | |
118 | 172 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 173 | | |
123 | 174 | | |
124 | 175 | | |
| |||
0 commit comments