fix: Report media failures once per failure (#2666)

This commit is contained in:
Dermot Duffy
2026-08-09 10:48:17 -07:00
committed by GitHub
parent 8d8d486afa
commit 5e199b5612
22 changed files with 484 additions and 123 deletions
@@ -179,6 +179,40 @@ describe('AdvancedCameraCardViewerCarousel', () => {
);
});
it('should build a new player for a failed clip when the retry control is used', async () => {
vi.useFakeTimers();
onTestFinished(() => {
vi.useRealTimers();
});
const { card, frigate } = await mountCardWithFrigate(EVENTS, {
// Automatic retries switched off, so the control below is the only one.
view: { default: 'clips', issues: { retry_seconds: 0 } },
status_bar: { style: 'outside' },
});
frigate.setMediaURL('newer', 'clips', createFailingMediaURL());
await waitForThumbnails(card, EVENTS.length);
await clickThumbnail(card.card, 0);
const failedPlayer = await card.waitForSelector('video');
await card.advanceSeconds(MEDIA_LOADING_TIMEOUT_SECONDS);
await card.waitForRender(
() => getStatusBarItem(card.card, MEDIA_ISSUE_TITLE),
`the ${MEDIA_ISSUE_TITLE} issue being reported`,
);
await card.clickControl(MEDIA_ISSUE_TITLE);
await card.clickControl('Retry');
// A second player, not the one that failed: the retry throws the old one
// away, and the replacement has to render and ask for the clip again rather
// than sit there empty.
await card.waitForRender(() => {
const player = deepQuery(card.card, 'video');
return player && player !== failedPlayer ? player : null;
}, 'the clip player being rebuilt');
});
it('should return to the gallery from the viewer', async () => {
const card = await mountViewer(EVENTS, {
config: {