mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-10 18:04:06 +02:00
fix(download): recover queue after worker timeout (#524)
This commit is contained in:
1 parent
1d363d5166
commit
95f2879110
6 files changed
+125
-4
No files matched your search
@@ -51,4 +51,42 @@ void main() {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
group('native worker stop recovery', () {
|
||||
test('requeues every in-flight snapshot state after the worker stops', () {
|
||||
for (final status in const ['preparing', 'downloading', 'finalizing']) {
|
||||
expect(
|
||||
nativeWorkerStatusAfterSnapshotStop(
|
||||
workerRunning: false,
|
||||
status: status,
|
||||
),
|
||||
'queued',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('preserves terminal states and live worker progress', () {
|
||||
expect(
|
||||
nativeWorkerStatusAfterSnapshotStop(
|
||||
workerRunning: false,
|
||||
status: 'completed',
|
||||
),
|
||||
'completed',
|
||||
);
|
||||
expect(
|
||||
nativeWorkerStatusAfterSnapshotStop(
|
||||
workerRunning: false,
|
||||
status: 'failed',
|
||||
),
|
||||
'failed',
|
||||
);
|
||||
expect(
|
||||
nativeWorkerStatusAfterSnapshotStop(
|
||||
workerRunning: true,
|
||||
status: 'downloading',
|
||||
),
|
||||
'downloading',
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user