Skip to content

fix(vidstack): guard stale hls instance callbacks - #1806

Merged
mihar-22 merged 1 commit into
mainfrom
fix/1787-hls-destroyed-instance-guard
May 25, 2026
Merged

fix(vidstack): guard stale hls instance callbacks#1806
mihar-22 merged 1 commit into
mainfrom
fix/1787-hls-destroyed-instance-guard

Conversation

@mihar-22

Copy link
Copy Markdown
Member

Summary

  • Guard HLS event callbacks against callbacks from destroyed or replaced instances.
  • Replace unsafe this.#instance! callback reads with captured instance references.
  • Return from LEVEL_LOADED when the HLS media element is unavailable.
  • Add focused HLS regression coverage for stale LEVEL_LOADED callbacks after destroy and missing media.

Fixes #1787

Validation

  • pnpm --filter vidstack test -- src/providers/hls/hls.test.ts - passed (1 file, 2 tests)
  • pnpm --filter vidstack typecheck - passed

@mihar-22 mihar-22 changed the title fix: guard stale hls instance callbacks fix(vidstack): guard stale hls instance callbacks May 25, 2026
@mihar-22
mihar-22 marked this pull request as ready for review May 25, 2026 04:55
@mihar-22
mihar-22 merged commit 20e07b3 into main May 25, 2026
1 check passed
@mihar-22
mihar-22 deleted the fix/1787-hls-destroyed-instance-guard branch May 25, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: HLS provider uses non-null assertions on possibly destroyed instance

1 participant