Repository navigation
feat(ui): flush removable drives before unmount and copy success - #1193
Conversation
Wait for syncfs on a worker, then the existing GIO unmount, eject, or lock, before a removable volume leaves the sidebar. Hide only closes the progress overlay. Copies and cross-volume moves onto removable media sync that filesystem before success, and a move keeps the source when the flush fails. Closes lgse#1182
3e4b978 to
db6acce
Compare
Code review
BlockersNone. Nits
NotesUnmount, eject, and the unmount half of Lock call The browser leaves the volume before the flush. After a flush or GIO failure, the previous location is restored when that root is still a mount point and the browser is still on the location it moved to. A navigation the user made during the operation stays where they left it. Removable copy roots are selected when the mountinfo mount point equals a GIO mount root whose drive is removable or has removable media. When those paths differ, the copy skips Added tests cover distinct failure modes: flush-before-delete for move, replace, merge, and undo; cancel before the flush and cancel once CI was green at review time ( |
Description
Removable Unmount, Eject, and the unmount half of encrypted Lock flush the local mount with
syncfson a worker, then run the existing GIO call. The browser leaves that volume before the flush so directory monitors are dropped, and returns only if the release fails while the volume is still mounted. The drive stays in the sidebar, with a progress spinner, until the operation finishes. Hide, Close, and Escape dismiss only the overlay. Success says the drive can be unplugged only when it is removable or ejectable.A copy onto removable media shows “Writing to device…” and does not report success until
syncfsreturns. A cross-volume move, replace, merge, or undo syncs that filesystem after the copy and before the source is deleted. If the flush fails, the source stays in place. Cancelling or failing after bytes were written still flushes those roots, and a cancel does not report the transfer as finished.Visual evidence
Large copy and move operations to devices such as USB sticks now show real progress bars instead of hiding progress after the data is accepted but a write is still underway:

While writes are still finalizing, a modal displays the status correctly:

If a write is pending to the drive not initiated by Strata and the device is ejected, a popup notifies the user:

If dismissed, the device persists in the side bar with a spinner until operations are finalized:

How to test
Expected result: The drive is not dropped from the sidebar while writes are still flushing, Hide does not cancel the operation, a removable copy or move is not reported successful before
syncfsreturns, and a failed flush does not delete the only remaining copy.Related issue
Closes #1182