mirror of
https://github.com/nimbold/Firelink.git
synced 2026-09-02 14:07:57 +00:00
fix(persistence): harden cross-layer ownership
- Validate and sanitize renderer event payloads before UI projection - Fence stale enqueue cleanup by native lifecycle generation - Canonicalize empty startup hydration and harden SQLite backup durability - Add real-postcondition IPC, restart, storage, and queue regressions
This commit is contained in:
@@ -38,6 +38,26 @@ const ACTIVE_DOWNLOAD_STATUSES: ReadonlySet<DownloadStatus> = new Set([
|
||||
'moving',
|
||||
]);
|
||||
|
||||
const DOWNLOAD_STATUSES: ReadonlySet<string> = new Set([
|
||||
'ready',
|
||||
'staged',
|
||||
'downloading',
|
||||
'processing',
|
||||
'seeding',
|
||||
'waitingToSeed',
|
||||
'paused',
|
||||
'completed',
|
||||
'failed',
|
||||
'queued',
|
||||
'retrying',
|
||||
'verifying',
|
||||
'moving',
|
||||
]);
|
||||
|
||||
/** Runtime guard for values arriving from the untyped Tauri event channel. */
|
||||
export const isDownloadStatus = (status: unknown): status is DownloadStatus =>
|
||||
typeof status === 'string' && DOWNLOAD_STATUSES.has(status);
|
||||
|
||||
export const isActiveDownloadStatus = (status: DownloadStatus): boolean =>
|
||||
ACTIVE_DOWNLOAD_STATUSES.has(status);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user