fix: Clear stale media unavailable errors when a camera recovers (#2627)

- Closes: #2576
This commit is contained in:
Dermot Duffy
2026-07-28 21:21:50 -07:00
committed by GitHub
parent 231e3087b7
commit 15b08db3e8
49 changed files with 1128 additions and 229 deletions
@@ -13,6 +13,19 @@ const createHostInDocument = (): HTMLElement => {
// @vitest-environment jsdom
describe('ProviderErrorDetector', () => {
it('should not report a change when reset', () => {
const host = createHostInDocument();
const onChange = vi.fn();
const detector = new ProviderErrorDetector(host, onChange);
detector.subscribe();
dispatchLiveErrorEvent(host);
onChange.mockClear();
detector.reset();
expect(onChange).not.toHaveBeenCalled();
});
it('should start unknown', () => {
const detector = new ProviderErrorDetector(document.createElement('div'), vi.fn());
@@ -43,7 +56,7 @@ describe('ProviderErrorDetector', () => {
dispatchLiveErrorEvent(host, {
reason: 'unsupported',
detail: 'Codec not supported',
description: 'Codec not supported',
});
expect(detector.getVerdict()).toEqual({