mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
a09d71ed12
On the phone storage panel, when the operator accepted several category moves and the first migration failed to start (for example the server was busy), only that error was toasted. The other accepted moves stayed in a hidden queue with no hint, and started on their own later whenever the panel state happened to refresh. The desktop drops the rest of the queue, names it in a storage.migrate.queueDropped toast and refreshes the state, so the operator sees what did not move and saves again. Cause: useStoragePanel only dropped the queue when the dropQueueOnFailure option was set, and only the desktop set it. Fix: the option is gone and useStoragePanel always drops the rest of the queue on a failed start, toasts it and refreshes, for both shells. Red test: FE-ADMIN-STOR-PANEL-011 (useStoragePanel.test.ts) failed with "AssertionError: expected "vi.fn()" to be called 2 times, but got 1 times". Changed assertions in src/components/Admin/storage/useStoragePanel.test.ts: - FE-ADMIN-STOR-PANEL-011 (renamed from "by default a failed migration start only toasts and keeps the rest queued"): toast.error was called once, now twice; migrationQueue had length 1, now 0; refreshState was not called, now it is. - FE-ADMIN-STOR-PANEL-012: no assertion changed; it no longer passes the removed dropQueueOnFailure option.