Commit e7dd3ab
fix(remote-device): persist the session by default (#634)
* fix(remote-device): persist the session by default
Off-by-default meant a full browser re-authorization on every connector
start, each minting a fresh GoTrue session that nothing ever revokes. Those orphaned refresh-token
families get replayed, trip GoTrue's reuse detection, and revoke the
whole family including the token a healthy connector is holding, which
is the upstream trigger of the anon-key downgrade wedge (#632).
--persist-session stays as an accepted no-op; --no-persist-session
opts back out (tokens in memory only, re-auth every start).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fXdisjKmwoi5YGPK2YfBa
* fix(remote-device): apply the persist-session default on the shipped CLI path
Two review fixes:
- npm-scripts/remote.ts (the path `npx desktop-commander remote` actually
runs) still passed process.argv.includes('--persist-session') — an
explicit false whenever the flag was absent, so the constructor's
`?? true` default never applied where it matters. Parse
--no-persist-session there too, matching the device.ts entry.
- loadPersistedConfig() returned a previously saved session regardless of
the flag, so the first opted-out run silently skipped the promised
re-authorization and then discarded a possibly-rotated refresh token on
save. Only return it when persistence is on.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011rAeXGKpqJVmKJaNoVook1
* fix(remote-device): drop usage figures from persist-session comment
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Eduard Ruzga <wonderwhy.er@gmail.com>1 parent 9bd8422 commit e7dd3ab
3 files changed
Lines changed: 30 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
205 | | - | |
206 | | - | |
| 209 | + | |
| 210 | + | |
207 | 211 | | |
208 | 212 | | |
209 | 213 | | |
210 | 214 | | |
211 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
212 | 224 | | |
213 | 225 | | |
214 | 226 | | |
| |||
427 | 439 | | |
428 | 440 | | |
429 | 441 | | |
430 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
431 | 445 | | |
432 | 446 | | |
433 | | - | |
434 | | - | |
| 447 | + | |
| 448 | + | |
435 | 449 | | |
436 | 450 | | |
437 | 451 | | |
| |||
0 commit comments