fix(desktop): M8 audit batch 5 — stale-closure upload, memberStore verbs, orphaned share-management sweep (#214) #220

Merged
amiryahaya merged 1 commit from fix/m8-desktop-quick into main 2026-11-17 14:24:33 +01:00
Owner

M8-close audit remediation batch 5 (#214 findings M8-9, M8-10, M8-12).

M8-9 (silent mis-filing): the toolbar Upload button's useCallback had an empty deps array — navigating root → subfolder kept the mount-time closure, so files uploaded into the WRONG folder and the F-CLS1 level sheet never opened. Real deps; handleUpload now declared after runUpload (declaration order).

M8-10 (member management broken): updateMemberRole/removeMember doubled the /api prefix and used PUT where the server exposes PATCH — role changes and removals 404'd every time. loadMembers got the URL fix in #212; these two were missed.

M8-12 (ghost contracts): orphaned share-management surface swept — ShareDetailsDialog (never imported by any page), shareStore loadSharesForItem/updatePermission/setExpiry, tauri getSharesForItem/updateSharePermission/setShareExpiry (three commands absent from the Rust handler list), their mocks and mock-pinned test suites. This is the mock-only failure mode: the suites stayed green against a backend that never had the contract.

Deferred (tracked on #214/#215, needs dev-plan 2.5 key provisioning first): M8-3 (client KEM key generation+persist+publish — folder creation fails on fresh installs), M8-13 (receive-side share-envelope unpack — needs those keys).

Gates: tsc clean, vitest 1303 green (83 files).

Part of the M8-close FIX-ALL (umbrella #215, audit #214).

M8-close audit remediation batch 5 (#214 findings M8-9, M8-10, M8-12). **M8-9 (silent mis-filing)**: the toolbar Upload button's useCallback had an empty deps array — navigating root → subfolder kept the mount-time closure, so files uploaded into the WRONG folder and the F-CLS1 level sheet never opened. Real deps; handleUpload now declared after runUpload (declaration order). **M8-10 (member management broken)**: updateMemberRole/removeMember doubled the /api prefix and used PUT where the server exposes PATCH — role changes and removals 404'd every time. loadMembers got the URL fix in #212; these two were missed. **M8-12 (ghost contracts)**: orphaned share-management surface swept — ShareDetailsDialog (never imported by any page), shareStore loadSharesForItem/updatePermission/setExpiry, tauri getSharesForItem/updateSharePermission/setShareExpiry (three commands absent from the Rust handler list), their mocks and mock-pinned test suites. This is the mock-only failure mode: the suites stayed green against a backend that never had the contract. Deferred (tracked on #214/#215, needs dev-plan 2.5 key provisioning first): M8-3 (client KEM key generation+persist+publish — folder creation fails on fresh installs), M8-13 (receive-side share-envelope unpack — needs those keys). Gates: tsc clean, vitest 1303 green (83 files). Part of the M8-close FIX-ALL (umbrella #215, audit #214).
fix(desktop): M8 audit batch 5 — stale-closure upload, memberStore verbs, orphaned share-management sweep (#214)
All checks were successful
Security CI / security-scan (pull_request) Successful in 3m31s
Desktop CI / lint-and-test (pull_request) Successful in 19m12s
7ee2a57ab0
M8-9: the toolbar Upload button's useCallback had an empty deps array —
navigation kept the mount-time folderId/clsEnabled, so files uploaded
into the WRONG folder and the F-CLS1 level sheet never opened after
in-page navigation. Real deps ([clsEnabled, runUpload]); handleUpload
now declared after runUpload.

M8-10: memberStore updateMemberRole/removeMember doubled the /api
prefix (baseUrl already includes it — loadMembers was fixed in #212,
these two were missed) and used PUT where the server exposes PATCH —
member role changes and removals 404'd every time.

M8-12: orphaned share-management surface swept — ShareDetailsDialog
(never imported), shareStore loadSharesForItem/updatePermission/setExpiry,
tauri getSharesForItem/updateSharePermission/setShareExpiry (three
commands that don't exist in the Rust handler list), their mocks, and
their test suites. The suite pinned ghost contracts — green against a
broken backend, exactly the mock-only failure mode.

acceptShare/declineShare stay (SharedWithMePage legacy surface, 7.3).
Deferred with dev-plan 2.5: M8-3 (client KEM provisioning — folder
creation fails on fresh installs until keys are generated+persisted at
unlock) and M8-13 (receive-side share-envelope unpack — needs those
keys first). Tracked on #214/#215.

Gates: tsc clean, vitest 1303 green (83 files).
Sign in to join this conversation.
No description provided.