Repository navigation
Sign-out ejects the account's drives, signs it out in every folder and tidies the Drives list - #105
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Critical sign-out flaws can leave drives mounted after credential removal, eject another account’s drive, and leave shared folders incorrectly signed in or blocked after reauthentication.
6 open issues
Propagate sign-out after Keychain removal failure · New Restore shared-folder sign-in state after reauthentication · New Prevent mounts from racing with account sign-out · New Verify mounted volume identity before ejecting by saved path · New Include unregistered Cloud Drives folders in sign-out propagation · New Report and retry failed shared-folder sign-out updates · New
What changed in this PR
This PR extends account sign-out across shared state folders, aiming to release mounted drives and remove idle signed-out folders from the Drives list while preserving local state.
Changes:
- Ejects account drives before sign-out and reports drives that cannot be ejected.
- Propagates signed-out state to matching accounts in known folders and adds list-cleanup rules.
- Adds shared-account and UI checks, plus documentation of the new behavior.
| File | Description |
|---|---|
Tests/StreamDriveCoreTests/CloudAccountStoreTests.swift |
Tests matching shared-account sign-out updates. |
Sources/StreamDriveCore/Cloud/CloudAccountStore.swift |
Adds sign-out marking without modifying the vault. |
README.md |
Documents ejection, shared sign-out, and list cleanup. |
macOS/Tests/UISnapshots.swift |
Checks busy-drive handling, propagation, and folder cleanup rules. |
macOS/App/StreamDriveApp.swift |
Coordinates drive ejection and removal of idle signed-out folders. |
macOS/App/CloudAccountModel.swift |
Integrates ejection and shared-record updates into sign-out. |
macOS/App/CloudAccountDeletion.swift |
Adds eligibility checks for signed-out folder cleanup. |
macOS/App/AppUpdater.swift |
Generalizes the ejection failure log message. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Account restoration can race with sign-out or precede a cancelled drive choice, leaving folders marked signed in after their credentials have been removed.
4 open issues
6 resolved since last review
Verify mounted volume identity before ejecting by saved path Prevent mounts from racing with account sign-out Restore shared-folder sign-in state after reauthentication Propagate sign-out after Keychain removal failure Report and retry failed shared-folder sign-out updates Include unregistered Cloud Drives folders in sign-out propagation
Review effort: Balanced
…d tidies the Drives list On Thomas's Mac (build 92), signing out of one account left its drive mounted at /Volumes/ParaOS: the Drives list kept it as "Needs sign-in" with no way to remove it, the next account's drive mounted under another name, and setup-status still reported the account signed in, in a second folder sharing its sign-in. - Sign-out now ejects every mounted drive of the account, in every folder the app knows, before the record changes. A drive with files open isn't forced: the account stays signed in and Storage Settings names the drive to close files on. - CloudAccountStore.markSignedOut: the account is marked signed out in every other folder holding a copy of the same sign-in (same id and binding), so setup-status stops reporting it signed in there. - Other folders of that account leave the Drives list once their drives are unmounted and nothing in them waits to upload (SignedOutFolders.idle), and so does the folder the app leaves when another account signs in. State folders stay; Choose State Folder... brings one back. - Checks: CloudAccountStoreTests (markSignedOut) and UISnapshots checkSignOutDrives (busy drive keeps the sign-in, both folders signed out, the app is told, which folders may leave the list).
…drives by state folder Review fixes: - The copies follow whenever the selected record says signed out, including when removing the Keychain item fails (the error is still shown). - Signing in again restores copies a sign-out marked signed out (CloudAccountCopies.restore, through share, which checks the vault). - Mounts of the account's drives are refused while sign-out runs; one already connecting is waited for (30 s), the selected drive's Finder setup is cancelled, and the gate lifts when sign-out ends either way (signOutFinished). - Drives to eject are found by the state folder they were mounted from (ParaAirVolumes.mountedByStateRoot), not a saved mount point another account's drive may now use; the Drives-list tidy uses the same. - Cloud Drives folders the app hasn't learned (connect --new-state-folder) are included (CloudDriveSetup.ownedCloudDriveFolders). - Copy updates that fail are retried once, then reported in Storage Settings instead of passing silently (CloudAccountCopies.Outcome.failed).
…onnect them, portable folder check - Copies are restored only once sign-in is complete: on the existing-drive path or after a drive choice succeeds (a cancelled choice removes the tokens), and awaited before the account counts as signed in, so no sign-out can overlap it. - Restored folders that mount at login are queued again and renewed (MenuModel.requeueRestoredDrives), so pending uploads resume. - Remove from List decides "mounted" by the folder a mount came from, as sign-out's eject does; a mount source may be a file URL or a plain path, and a source naming no folder falls back to the saved mount point. - CloudDriveSetup.ownedCloudDriveFolders uses PlatformFS (builds on Windows); its test runs on macOS only (Cloud Drives follows LOCALAPPDATA/XDG elsewhere).
7b287de to
3fbd9fb
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved restoration races can mark account copies signed in after sign-out removes tokens, while unreadable profiles can leave shared drives mounted after credentials are removed.
4 open issues
4 resolved since last review
Review effort: Balanced
…rofiles, no stray locks, cleanup vs restore - restoreCopies keeps the model busy throughout (sign-out waits for it), even when the sign-in is cancelled meanwhile. - Eject also looks at Cloud Drives folders the CLI made; a folder whose profile can't be read but holds this account's record has its mounts found by the folder they came from. - markSignedOut checks for the record before taking the lock, so folders that never held the account get no cloud-accounts folder or lock file. - A Drives-list cleanup is dropped if a sign-in restored folders meanwhile, and each folder is checked again on the main actor right before removal.
**Merge only after release 462150473 (tag `v0.1.0-alpha.15`) is published.** Until then the feed would point at an archive that doesn't exist yet. - `site/appcast.xml`: a new first item for ParaAir 0.1.0 alpha 15 (build 96, minimum macOS 26.0). - Its enclosure is `https://github.com/parafieldai/ParaAir/releases/download/v0.1.0-alpha.15/ParaAir-0.1.0-alpha.15.zip`: length 50350442, SHA-256 `ecc52382a3fee2bd88bf694e9842cd12e30b969b0d13b17448385eb10f21d00b`, with the archive's EdDSA signature. - The whole feed was re-signed with the `paraair` key by `scripts/make-appcast.py`. `make-appcast.py --check` passes: 12 items, newest build 96. - `index.html`, `pricing.html`, `get-started.html`: the Mac download buttons and labels now point at `v0.1.0-alpha.15` (`scripts/update-site-release.py` with the DMG, 56 MB). The Windows download links (`data-win-download`) still point at alpha 14, because this release has no Windows assets. - `scripts/check-site.py site` and `node scripts/check-signup.mjs` pass. App changes in alpha 15: - #105: signing out ejects the account's drives, signs the account out in every folder, and tidies the Drives list. - #104: the shared core is now portable for Windows. No change in how the Mac app works. The extension identity is unchanged since alpha 14.


On Thomas's Mac (ParaAir build 92, alpha 14), signing out of
team@parafield.aiin Storage Settings and signing in asthomas@parafield.aicaused four problems:/Volumes/ParaOSstayed mounted.CloudAccountModel.signOutonly marked the selected folder's account signed out and removed its Keychain item./Volumes/ParaOSand mounted at/Volumes/ParaAir Cloudinstead.setup-statusstill reported team@'s drive as mounted and healthy. It also reported a second folder sharing the same sign-in (ParaOS-B) assignedIn.The owner asked for this to be fixed and cleaned up.
What changes
MenuModel.ejectDrives(ofAccount:)). Nothing is forced closed. If a drive has files open, the account stays signed in and Storage Settings says: "“ParaOS” is in use, so you’re still signed in. Close the files open on it, then sign out again." Those folders also stop waiting for a login mount or Connect, so nothing reconnects them during sign-out.CloudAccountStore.markSignedOut(_:binding:)marks each other folder's copy of the same sign-in (same id and binding) as signed out. The vault isn't touched; the shared Keychain item is already gone. This meanssetup-statusno longer reports a signed-out account as signed in in a second folder.SignedOutFolders.idle). The folder the app leaves when another account signs in is removed the same way (adoptStateRoot). A folder holding any other kind of drive, or one with files still waiting to upload, stays listed. State folders are kept, and Choose State Folder… brings one back. Once a drive is unmounted, Remove from List… is offered again as before.Checks
swift test --filter Cloud: 178 tests pass (4 skipped), including the newtestMarkSignedOutUpdatesSharedCopiesOnly.scripts/build-juicefs.shandscripts/build-app.shbuild in a fresh worktree.scripts/render-ui-snapshots.shpasses, including the newcheckSignOutDrives: