Skip to content

fix(web): load a failed HLS manifest again instead of waiting for the startup timeout - #2293

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/web-player-retry-failed-manifest
Oct 21, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/web-player-retry-failed-manifest

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1176
Validation tasks: changes #1178 C2

When the web player switches to a new HLS stream and that stream's master playlist fails to load, the player shows a spinner for a full minute before it asks the server for another route. One way to get there is a transcode node that dies just as the player reconnects to it.

On a fatal network error before the first frame, the player asks hls.js to startLoad() again. hls.js never requests a master playlist that failed to load in that call, so nothing more happens, no second error arrives, and the player waits out its 60-second startup timeout before it reports the route as failed and replans.

For a failed manifest, the player now loads the source again. If that load fails too, the startup guard reports the route as failed at once, so the replan starts within a few seconds instead of a minute. Fragment and playlist errors keep using startLoad(), which does retry them.

Approach

  • Only the three manifest error details (manifestLoadError, manifestLoadTimeOut, manifestParsingError) reload the source; the URL is the same one the transport loaded first.
  • The startup guard is unchanged: one recovery, then a startup_timeout plan failure, as before.

Validation

  • Tests: a fatal manifest error loads the same source again, does not call startLoad(), and a second one reports the plan failed. The new test fails without the change. The hls.js test mocks gained the ErrorDetails constants the code now reads.
  • pnpm exec vitest run for the player components: pass.
  • End to end on a local stack with the API server and nodes on main (web player, two transcode nodes, one proxy), killing the transcode node with SIGKILL right after a health sweep, so the server hands the reconnect the dead node's URL: before, the player sat on the spinner for 60 seconds before it reported the failure; after, it reported it 7 seconds after the dead manifest. On main that recovery replan is then refused as adaptation_exhausted, a server problem fixed separately in fix(playback): replan around a transcode or proxy node that stopped answering #2292; with that fix the reconnect doesn't get the dead URL in the first place.
  • Gate: web lint, format, build, budget and make test-web pass, and so do the Go build, vet, lint and every verify-* target. make test-go fails on this macOS host in the same tests as on main; this change has no Go code.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-2293/

Risks

None identified. A manifest that keeps failing still ends in the same plan failure, only sooner.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code (running in T3 Code)
  • Tool(s): Claude Code, GitHub CLI, Playwright
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

@silo-kody

silo-kody Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T21:24:16.423338Z 9120c4c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 039ed78b-252c-410f-89fe-19a26f68d5d0

📥 Commits

Reviewing files that changed from the base of the PR and between 9120c4c and bf28be7.


📒 Files selected for processing (2)
  • web/src/player/components/VideoPlayer.test.tsx
  • web/src/player/components/VideoPlayer.tsx

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e273ba77-dd0f-443a-80f0-c9ad15976f1a



📥 Commits

Reviewing files that changed from the base of the PR and between a6a620c and 9120c4c.




📒 Files selected for processing (3)
  • web/src/player/components/VideoPlayer.reconnect.test.tsx
  • web/src/player/components/VideoPlayer.test.tsx
  • web/src/player/components/VideoPlayer.tsx



Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.





📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

Fatal HLS manifest load, load-timeout, and parsing errors now reload the effective stream URL. Other fatal network errors retain the startLoad() recovery path. Tests cover a retry and a subsequent startup_timeout plan failure.

Changes

HLS manifest error recovery

Layer / File(s) Summary
Manifest recovery and regression coverage
web/src/player/components/VideoPlayer.tsx, web/src/player/components/VideoPlayer.test.tsx, web/src/player/components/VideoPlayer.reconnect.test.tsx
Fatal manifest-related errors reload the effective stream URL; other fatal network errors continue to call startLoad(). The tests verify the first reload and that a second error 10 seconds later reports one startup_timeout plan failure.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: quick104





Merge Risk: ⚪ Minimal · up to 9120c

This change makes the player retry a failed HLS manifest by reloading the source, instead of waiting out the 60-second startup timeout. It is narrowly scoped and tested, and no merge-blocking risk was found.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the primary change: retrying a failed HLS manifest instead of waiting for the startup timeout.
Description check Passed The description directly explains the HLS manifest recovery problem, the implementation, validation results, and expected behavior.



✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR





  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@silo-triage silo-triage Bot added bug Something isn't working impact: playback Can't play, stalls, or wrong media javascript Pull requests that update javascript code priority: P1 Core-path bug; painful workaround — next after P0 labels Oct 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9120c4cfb6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@silo-kody

silo-kody Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 1 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers

@Quick104

Copy link
Copy Markdown
Contributor

Maintainer review summary

Reviewed head: bf28be7516191de7c1118138c9bf90af3f342271

No defects found. The change is ready to merge.

What I checked

  • Main still recovers from every fatal startup network error with startLoad(), so the PR is still needed. It merges cleanly with current main, and the player tests (192) and the type check pass on the merged tree.
  • I checked the hls.js 1.6.15 source. startLoad() does not request a master playlist again. loadSource() with the same URL and no buffered source types does not detach the media; it stops loading and starts a new manifest load. hls.js reports manifestParsingError as a network error, so all three details reach this branch.
  • I traced the cooldown bypass. The flag is set only before the transport has played, and the next fatal error clears it. The startup guard allows one recovery, so a second manifest failure ends in startup_timeout instead of another reload. settlePaused() can mark the guard playable without playback starting, but that needs a loaded manifest, so it can't cause repeated reloads.
  • Tests: both new tests in VideoPlayer.test.tsx fail on the merge base (loadSource called once, expected twice) and pass on the head.
  • Cross-provider round (Codex gpt-6.1-sol, one round, read-only): no findings. It ran the handler against hls.js 1.6.15 with a synthetic loader. Repeated parse errors, 404s, and timeouts each produced two requests and one startup failure. Start position and audio and subtitle tracks survived a successful reload. A network loss after playback still reached the reconnect path.

Earlier threads: the Kody and Codex findings about the 3-second cooldown are fixed in bf28be751, and the 500 ms test covers that case.

Remaining for maintainers: nothing blocking. I didn't reproduce the node-kill scenario live. The end-to-end result is the author's, from the evidence page.

Validated features: #1178 C2 (worker-loss monitoring) is still "Not run", so this change affects no passed case.

User manual: no change needed. The manual doesn't document the player's internal startup recovery timing.

Apple/Android: no follow-up. This is a workaround for hls.js behavior; the native apps use their platform players.

Fit: 9/10 · Readiness: 9/10 — ready

  • Fit: a small fix at the right boundary for a core reliability case, where a node dies while a stream is starting. It adds no settings or API surface.
  • Readiness: the fix is narrow and does what the description says. Tests that fail on the base cover it, and an independent run against the real hls.js build confirmed it.

@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Oct 21, 2026
@Quick104
Quick104 merged commit bfeecfe into Silo-Server:main Oct 21, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: playback Can't play, stalls, or wrong media javascript Pull requests that update javascript code priority: P1 Core-path bug; painful workaround — next after P0 size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants