mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-27 19:17:13 +00:00
fix: harden scheduler, permissions, and download safety
- Implement scheduler hydration barrier to prevent premature triggers - Track scheduler exact runs using keys to avoid false stops - Use 'System Events' for accurate macOS automation permissions - Prevent system-sleep via proper idle assertions - Ensure download pauses use channel acknowledgements (PauseWithAck) - Require Firelink ownership before replacing files in add/conflict UI - Retain partial download assets when removing entries without deletion - Clear progress state in store when downloads complete or pause to reduce churn - Handle empty/invalid queue selections gracefully
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { useDownloadProgressStore } from './downloadStore';
|
||||
|
||||
describe('useDownloadProgressStore', () => {
|
||||
beforeEach(() => {
|
||||
useDownloadProgressStore.setState({ progressMap: {} });
|
||||
});
|
||||
|
||||
it('prunes terminal progress entries', () => {
|
||||
useDownloadProgressStore.getState().updateDownloadProgress('download-1', {
|
||||
id: 'download-1',
|
||||
fraction: 0.5,
|
||||
speed: '1 MB/s',
|
||||
eta: '10s',
|
||||
size: '2 MB',
|
||||
size_is_final: false
|
||||
});
|
||||
|
||||
useDownloadProgressStore.getState().clearDownloadProgress('download-1');
|
||||
|
||||
expect(useDownloadProgressStore.getState().progressMap).toEqual({});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user