feat: Add hardened error handling and retries (#2451)

- Closes #1830
 - Closes #2099
This commit is contained in:
Dermot Duffy authored and dermotduffy committed 2026-06-30 17:45:12 -07:00
1 parent 4bc787e2b7
commit 47bcce93d3
182 files changed
+7877 -4043

No files matched your search

@@ -94,9 +94,15 @@ describe('ViewItemManager', () => {
vi.mocked(homeAssistantGetSignedURLIfNecessary).mockRejectedValue(signError);
expect(await manager.download(item)).toBe(false);
expect(api.getMessageManager().setErrorIfHigherPriority).toHaveBeenCalledWith(
expect(api.getNotificationManager().setNotification).toBeCalledWith(
expect.objectContaining({
message: 'Could not sign media URL for download',
heading: expect.objectContaining({
text: 'Download failed',
icon: 'mdi:download-off',
}),
body: expect.objectContaining({
text: 'Could not sign media URL for download',
}),
}),
);
expect(consoleSpy).toHaveBeenCalledWith('sign-error');
@@ -169,9 +175,15 @@ describe('ViewItemManager', () => {
const item = new TestViewMedia({ cameraID: null, folder: null });
expect(await manager.download(item)).toBe(false);
expect(api.getMessageManager().setErrorIfHigherPriority).toHaveBeenCalledWith(
expect(api.getNotificationManager().setNotification).toBeCalledWith(
expect.objectContaining({
message: 'No media to download',
heading: expect.objectContaining({
text: 'Download failed',
icon: 'mdi:download-off',
}),
body: expect.objectContaining({
text: 'No media to download',
}),
}),
);
});