Skip to content

fix(#275): classics timeout and subtitle vtt noise#286

Open
DSanich wants to merge 3 commits into
divinevideo:mainfrom
DSanich:fix/275-classics-timeout-and-subtitle-vtt-noise
Open

fix(#275): classics timeout and subtitle vtt noise#286
DSanich wants to merge 3 commits into
divinevideo:mainfrom
DSanich:fix/275-classics-timeout-and-subtitle-vtt-noise

Conversation

@DSanich
Copy link
Copy Markdown
Contributor

@DSanich DSanich commented Apr 28, 2026

Summary

This PR fixes two production-facing feed stability issues:

  1. Subtitle VTT fallback requests were generating noisy Sentry errors (422) for optional subtitle assets.
  2. The Discovery Classic tab could fail to load when randomized pagination started at high offsets that timeout on the backend.

Problems Addressed

1) Subtitle VTT noise in Sentry

Optional subtitle CDN endpoints (/vtt) can return 404/410/422 when subtitles are not available.
These were being captured as failed HTTP errors and surfaced as production noise.

2) Classic feed startup failures

Classic feed startup uses randomized offset pagination.
High offsets (example: offset=312) are currently unstable and can return backend timeout errors, which caused blank/error first loads for users.

What Changed

Subtitles

  • Updated subtitle loading logic in useSubtitles to:
    • avoid blind /vtt probing for videos without text-track metadata;
    • only use CDN VTT fallback when a text track is actually advertised;
    • treat 404/410/422 as benign "no subtitles" outcomes.

Sentry filtering

  • Added a narrow Sentry filter to drop only benign subtitle VTT events:
    • URL matches media.divine.video/*/vtt
    • status code is one of 404, 410, 422
  • Non-benign failures (e.g. 500) are still reported.

Classics feed stabilization

  • Reduced classics randomization window to a lower, stable range to avoid high-offset timeout-prone queries.
  • Added test coverage for the classics randomization configuration.

Files

  • src/hooks/useSubtitles.ts
  • src/hooks/useSubtitles.test.ts
  • src/lib/sentry.ts
  • src/lib/sentry.test.ts
  • src/hooks/useVideoProvider.ts
  • src/hooks/useVideoProvider.test.ts

Closes #275

@github-actions
Copy link
Copy Markdown

🚀 Preview Deployment

Property Value
Preview URL https://5e8dd481.divine-web-fm8.pages.dev
Commit 492ef30
Branch fix/275-classics-timeout-and-subtitle-vtt-noise

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.

fix(subtitles): treat missing public VTTs as benign and suppress Sentry noise

1 participant