fix: add catch fallback to getRandomItems API query on home page load - #306
Merged
RadicalMuffinMan merged 2 commits intoJul 15, 2026
Merged
Conversation
This prevents slow database scans from timing out and crashing the entire home page loading sequence.
✅ Build SuccessfulAll platform builds passed. You can download the test artifacts below.
|
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This prevents slow database scans from timing out and crashing the entire home page loading sequence.
Pull Request
Summary
This PR resolves a critical startup crash on the browse/home page.
During startup, the client queries for random media items to display as the featured background card at the top of the homepage (
api.getRandomItems(...)). On slower servers (like home NAS setups) or large databases, this query frequently takes more than 15 seconds to run, exceeding the client-side timeout limit.Since this call was previously part of the main
Promise.allblock without a catch fallback, a timeout on the background card query would abort the entire loader promise, causing the homepage to crash and display "No content found" rather than fallback rows.Related Issues
Link related issues or tickets separated by commas.
Type of Change
Changes Made
List the key changes included in this PR.
Browse.js: Added
.catch(() => null)toapi.getRandomItemsso that slow random backdrop scans do not block or crash the initial loading of critical homepage elements (such as libraries, "Continue Watching", and "Next Up").ModernMediaRow.js: Replaced the React component instance ref wrapper check with a native DOM element query (
document.querySelector) and added a fallback type check. This resolves the uncaughtTypeError: rowNode.contains is not a functioncrash that was being thrown in the console whenever focus left a row.Platform
Testing
Describe how this change was tested.
Test Steps
Screenshots (if applicable)
Include screenshots or recordings for UI changes.
Checklist