mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-26 12:52:40 +02:00
fix(download): recover queue after worker timeout (#524)
This commit is contained in:
@@ -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