From 010cf55302de8c1ab1523b0e6ea396679a282328 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Mon, 2 Feb 2026 10:13:14 +0530 Subject: [PATCH] fix: show alert instead of redirecting to non-existent /client route When profile guard fails (single-player profile detected): - Show JavaScript alert explaining the issue - Leave session cleanly via handleLeaveSession() - Redirect to dashboard (/) instead of /client (404) Alert message explains: - Audio profile not suitable for multi-user sessions - Need proper audio interface or create private session TODO: Replace alert() with proper modal dialog component that offers options like legacy app (create private session, go to audio settings, cancel). Co-Authored-By: Claude Sonnet 4.5 --- jam-ui/src/components/client/JKSessionScreen.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jam-ui/src/components/client/JKSessionScreen.js b/jam-ui/src/components/client/JKSessionScreen.js index 9654450fc..396eea1e8 100644 --- a/jam-ui/src/components/client/JKSessionScreen.js +++ b/jam-ui/src/components/client/JKSessionScreen.js @@ -376,10 +376,17 @@ const JKSessionScreen = () => { } catch (error) { logger.error("User profile is not appropriate for session:", error); - // If error doesn't control navigation, redirect to home (legacy behavior) + // If error doesn't control navigation, show alert (legacy behavior shows dialog) if (!error?.controlled_location) { - logger.debug("Profile guard failed, redirecting to home"); - history.push('/client'); + logger.debug("Profile guard failed, showing alert"); + // TODO: Replace with proper JKSessionProfileDialog component + alert( + 'Your current audio profile is not suitable for multi-user sessions.\n\n' + + 'Please configure a proper audio interface in your audio settings, ' + + 'or create a private session for solo practice.' + ); + await sessionModel.handleLeaveSession(); + history.push('/'); // Redirect to dashboard return; // Don't continue with session join } // If controlled_location is true, the error handler already redirected