fix(11-02): correct chat API parameter name (session_id → music_session)

P0 Critical Bug Fix:
- Frontend was sending session_id but backend expects music_session
- This caused 404 errors when submitting chat messages
- Fixed in sendChatMessage function (jam-ui/src/helpers/rest.js:993)

Root cause: Parameter name mismatch between frontend and backend
- Frontend: body.session_id = sessionId
- Backend: params[:music_session]
- Result: ActiveRecord.find(nil) → 404 error

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Nuwan 2026-01-31 19:18:25 +05:30
parent a9178bd68b
commit 5b940ae7f4
1 changed files with 1 additions and 1 deletions

View File

@ -990,7 +990,7 @@ export const getChatMessages = async ({ channel, sessionId, before }) => {
*/
export const sendChatMessage = async ({ channel, sessionId, message }) => {
const body = { channel, message };
if (sessionId) body.session_id = sessionId;
if (sessionId) body.music_session = sessionId;
const baseUrl = process.env.REACT_APP_API_BASE_URL;
const response = await fetch(`${baseUrl}/chat`, {