Description
Navigating to /user/<any-made-up-name> returns HTTP 200 and renders the full user profile shell. The page title shows "Performance Profile: @", all stats are blank, and charts are empty. There is no error state shown to the visitor and the browser reports a successful page load.
Steps to Reproduce
- Start the server locally.
- Navigate to
/user/this-user-does-not-exist.
- Observe: HTTP 200, full page renders with heading "Performance Profile: @this-user-does-not-exist", blank charts, blank stats, no error message.
Expected Behavior
A non-existent username should produce a visible error, either a 404 response from the server, or at minimum a clear in-page error message that the user could not be found, consistent with how /leaderboard handles data load failures via its #leaderboard-error element.
Actual Behavior
HTTP 200 is returned for any username string. fetchUserData() in historical-graphs.js catches the API error but only console.logs it, no in-page feedback:
} catch (error) {
console.log("error loading performance statics: ", error);
}
The page renders as if it loaded successfully, just with no data.
Root Cause
Two separate gaps:
server.js (line 135): The route serves user.html for any :username value without checking whether that user exists in the data:
app.get("/user/:username", (req, res) => {
serveHtml(res, path.join(__dirname, "frontend", "user.html"));
});
frontend/js/user/historical-graphs.js (line 39): The fetch error is silently swallowed with no UI update:
} catch (error) {
console.log("error loading performance statics: ", error);
}
Suggested Fix
In historical-graphs.js, show a visible error element on fetch failure, matching the pattern used in leaderboard.html:
} catch (error) {
console.log("error loading performance statics: ", error);
const errorEl = document.getElementById("profile-error");
if (errorEl) errorEl.style.display = "block";
}
Add a corresponding #profile-error element to user.html
Optionally, the server route can validate the username against the data repo before serving the page and return a 404 for unknown users.
Affected Files
server.js
frontend/js/user/historical-graphs.js
frontend/user.html
Description
Navigating to
/user/<any-made-up-name>returns HTTP 200 and renders the full user profile shell. The page title shows "Performance Profile: @", all stats are blank, and charts are empty. There is no error state shown to the visitor and the browser reports a successful page load.Steps to Reproduce
/user/this-user-does-not-exist.Expected Behavior
A non-existent username should produce a visible error, either a 404 response from the server, or at minimum a clear in-page error message that the user could not be found, consistent with how
/leaderboardhandles data load failures via its#leaderboard-errorelement.Actual Behavior
HTTP 200 is returned for any username string.
fetchUserData()inhistorical-graphs.jscatches the API error but onlyconsole.logs it, no in-page feedback:The page renders as if it loaded successfully, just with no data.
Root Cause
Two separate gaps:
server.js(line 135): The route servesuser.htmlfor any:usernamevalue without checking whether that user exists in the data:frontend/js/user/historical-graphs.js(line 39): The fetch error is silently swallowed with no UI update:Suggested Fix
In
historical-graphs.js, show a visible error element on fetch failure, matching the pattern used inleaderboard.html:Add a corresponding
#profile-errorelement touser.htmlOptionally, the server route can validate the username against the data repo before serving the page and return a 404 for unknown users.
Affected Files
server.jsfrontend/js/user/historical-graphs.jsfrontend/user.html