mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-18 15:23:13 +00:00
fix(properties): harden torrent diagnostics lifecycle
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
beginExclusivePropertiesAction,
|
||||
createFrameCoalescer,
|
||||
getPropertiesLifecycleAction,
|
||||
isExpectedPropertiesDiagnosticUnavailable,
|
||||
sanitizePropertiesSnapshot,
|
||||
} from './propertiesBridge';
|
||||
|
||||
@@ -135,6 +136,14 @@ describe('Properties window bridge', () => {
|
||||
expect(getPropertiesLifecycleAction('completed')).toBeNull();
|
||||
});
|
||||
|
||||
it('recognizes expected diagnostics gaps without hiding real RPC failures', () => {
|
||||
expect(isExpectedPropertiesDiagnosticUnavailable(new Error('live Torrent file progress is unavailable'))).toBe(true);
|
||||
expect(isExpectedPropertiesDiagnosticUnavailable(new Error('active Torrent transfer has no current gid mapping'))).toBe(true);
|
||||
expect(isExpectedPropertiesDiagnosticUnavailable(new Error('Torrent lifecycle changed while reading peer diagnostics'))).toBe(true);
|
||||
expect(isExpectedPropertiesDiagnosticUnavailable(new Error('aria2.getPeers failed: unavailable response'))).toBe(false);
|
||||
expect(isExpectedPropertiesDiagnosticUnavailable(new Error('aria2.getFiles failed: connection refused'))).toBe(false);
|
||||
});
|
||||
|
||||
it('keeps the first action locked when a duplicate request is rejected', () => {
|
||||
const inFlight = new Set<string>();
|
||||
const release = beginExclusivePropertiesAction(inFlight, 'window:download');
|
||||
|
||||
Reference in New Issue
Block a user