Soft logout keeps local data; MAS front hides register and reset #145
Loading…
Reference in a new issue
No description provided.
Delete branch "void/mas-client-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two client fixes for the MAS window (follow-ups
ratatoskr:follow_up:mas-audit-sessions,mas-audit-gaps-and-oidc-scope; askchat-s7472-7473). Not merged, not deployed.1. Soft logout keeps local data.
SessionLoggedOutwithdata.soft_logout === trueno longer wipes: the client stops, only the access token is removed, and a small record {userId, deviceId} (state/softLogout.ts) is kept. The sign-in page then says the session expired, fixes the username to that user, and sendsdevice_idon both password andm.login.tokenrequests. Same user and device back: stores kept, record cleared. Different user or device (also new registration): onewipeLocalData()first. "Sign in as someone else" is the hard path. Anything that is notsoft_logout === truestays hard. The listener is idempotent (the SDK emits once per failing request):createLogoutHandler, tested with repeated events.One wipe owner: logout, hard listener,
clearLoginDataand mismatch sharewipeLocalData, which now also deletes every IndexedDB database (a superset of the old wipe; it also clears the service worker's push-session DB) and swallowsclearStoreserrors.2. MAS front. Detected pre-login from autodiscovery
org.matrix.msc2965.authentication(account ?? issuer, https or localhost only; the devices page uses the same preference post-login). Under MAS: Forgot-password link hidden;ResetPasswordand, when noregistrationentry is configured,RegisterRouteand the bare Register link show a pointer to the account page. A configuredregistrationEntry(with its training notice) is deliberately kept, since it is where newcomers see the consent text. Non-MAS render paths unchanged.Soul pass: found a duplicate-event wipe regression, the consent regression and a register-path stale record; all fixed in the second commit. Hands' behavior tests cover the handler,
settleLocalData,masAccountUrl, RegisterRoute MAS cases. Remaining guards are source-level (repo has no React testing library). Full suite: 1382 pass, 1 timeout infeatures/scene/index.test.ts(passes alone; load flake, not touched here).Could not be seen without a real MAS (for Eureka's scratch MAS):
device_idon compatm.login.passwordandm.login.token? If it hands back another device, the keep path never fires (mismatch wipe applies).soft_logout: true? If it sendsM_UNKNOWN_TOKENwithout it, every logout stays hard (today's behavior)./.well-known/matrix/clientadvertiseorg.matrix.msc2965.authenticationwithaccountorissuer? Without it the MAS front never activates.SessionLoggedOutcarrying the MatrixError withdata.soft_logoutis read from the SDK source, not a live emit.indexedDB.databases()fallback and the reload flow: no real-browser run.🤖 Generated with Claude Code