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
@@ -372,6 +372,28 @@ describe('StreamLivenessController', () => {
]);
});
it('should stop reporting a provider error once media loads', () => {
const { host, controller, issueResolves, failViaProviderError } = setup();
controller.hostConnected();
failViaProviderError({ reason: 'not_loading' });
host.dispatchEvent(createMediaLoadedInfoEvent({ info: createMediaLoadedInfo() }));
// The detector holding the failure goes quiet rather than claiming the
// stream is live, so this controller has nothing to state either way.
expect(controller.isLive()).toBe(true);
expect(issueResolves).toEqual([]);
});
it('should not resolve when media arrives with no failure to disprove', () => {
const { host, controller, issueResolves } = setup();
controller.hostConnected();
host.dispatchEvent(createMediaLoadedInfoEvent({ info: createMediaLoadedInfo() }));
expect(issueResolves).toEqual([]);
});
it('should not resolve while a hard failure exists', async () => {
const { issueResolves, failViaProviderError, fireMediaPlayerLiveness } =
await setupWithLiveStream();