Commit Graph

8144 Commits

Author SHA1 Message Date
Nuwan da4e864ab7 fix(15): correct API response field name (chats not messages)
The chat history API returns { chats: [...], next: ... } but the
fetchChatHistory.fulfilled handler was expecting { messages: [...] }.

This caused a TypeError when opening the chat window because
`messages` was undefined.

Fixed:
- sessionChatSlice.js: Extract `chats` from payload, default to []
- Updated all test payloads to use `chats` field name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 15:45:06 +05:30
Nuwan bfee9acdfb fix(15): resolve UAT issues - uploader message visibility and chat history
Issues found during UAT:
1. Uploader doesn't see their own attachment message
2. Chat history doesn't load on page refresh/rejoin

Root causes:
1. Backend's server_publish_to_session excludes sender from WebSocket
   broadcast (exclude_client_id: sender[:client_id])
2. fetchChatHistory was imported but never called in JKChatMessageList

Fixes:
- Add optimistic message in uploadAttachment.fulfilled for uploader
  Since sender is excluded from WebSocket, we add the message locally
  using the MusicNotation response + user info
- Add useEffect in JKChatMessageList to dispatch fetchChatHistory
  when channel becomes active

Technical details:
- Pass userId/userName to uploadAttachment thunk for message construction
- Use 'attachment-{notation.id}' as message ID to avoid collision
- Fetch history when fetchStatus is not 'loading' or 'succeeded'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 15:36:04 +05:30
Nuwan e9dd992e29 test(15-01): add real-time attachment sync integration tests
- Create test/attachments/real-time-sync.spec.ts
- Test WebSocket message receipt for attachments
- Test deduplication of duplicate messages
- Test REST API and WebSocket message deduplication
- Test attachment display in chat
- Uses Redux dispatch simulation approach for CI compatibility
2026-02-06 02:20:47 +05:30
Nuwan 86206e1992 refactor(15-01): clean up debug logging in WebSocket handler
- Remove console.log for received WebSocket messages
- Remove console.log for Redux dispatch
- Remove console.log for callback registration
- WebSocket handler verified: extracts all attachment fields correctly
2026-02-06 02:19:31 +05:30
Nuwan af40426a59 docs(15): create phase plan for Real-time Synchronization
Phase 15: Real-time Synchronization
- 1 plan in 1 wave
- Primarily verification phase confirming Phases 12-14 infrastructure
- Clean up debug logging, create integration tests
- Human verification checkpoint for multi-user sync testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 02:11:40 +05:30
Nuwan 0124977723 docs(14): complete chat-integration-and-display phase
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 01:59:48 +05:30
Nuwan 24ce6a6beb docs(14-03): complete REST API attachment transformation gap closure plan
Tasks completed: 2/2
- Task 1: Add REST API attachment transformation (TDD)
- Task 2: Verify gap closure with integration test

SUMMARY: .planning/phases/14-chat-integration-and-display/14-03-SUMMARY.md
2026-02-06 01:55:07 +05:30
Nuwan 977d1a9b95 feat(14-03): transform REST API music_notation to flat attachment fields
- Transform nested music_notation object from REST API to flat attachment fields
- Map music_notation.id → attachmentId, file_name → attachmentName, attachment_type → attachmentType
- Include purpose field from API response root
- Set attachmentSize to null (not available from REST API, only WebSocket)
- Matches WebSocket message format for consistent JKChatMessage rendering

Tests:
- Add test for REST API attachment transformation
- Fix pre-existing test bugs: incorrect sendMessage.fulfilled payload format
- Fix pre-existing test bug: fetchChatHistory deduplication test used wrong format
- All 89 tests now pass (previously 3 failures)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 01:52:40 +05:30
Nuwan d2dc3a8d63 docs(14): create gap closure plan for REST API attachment transformation
Phase 14: Chat Integration & Display
- 1 gap closure plan (14-03)
- Fixes REQ-2.5: Chat history includes attachments
- Root cause: fetchChatHistory.fulfilled missing music_notation transform
- Small fix: 5 lines to map nested object to flat attachment fields

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 01:34:30 +05:30
Nuwan c9b2ba7f10 docs(14-02): complete clickable links and responsive layout plan
Tasks completed: 3/3
- Task 1: Add click handler to fetch signed URL and open file
- Task 2: Add responsive styling with filename truncation
- Task 3: Human verification checkpoint (approved)

SUMMARY: .planning/phases/14-chat-integration-and-display/14-02-SUMMARY.md
2026-02-06 00:55:44 +05:30
Nuwan 1143048ec3 feat(14-02): add responsive styling with filename truncation
- Add flexWrap to header (name + timestamp wrap on narrow windows)
- Change filename maxWidth from 200px to 100% (takes available width)
- Add flexShrink: 0 to file size and paperclip icon (never shrink)
- Add fontSize: 13px to file size for consistent sizing
- Remove marginRight from paperclip icon (gap handles spacing)
- Ensure minWidth: 0 on content container for text-overflow to work
- Add comment clarifying header layout
- Layout responsive at different window sizes with proper truncation
2026-02-05 19:49:01 +05:30
Nuwan 91cac19a52 feat(14-02): add clickable attachment links with signed URL fetching
- Import getMusicNotationUrl REST helper and useState/useCallback hooks
- Add handleAttachmentClick handler that fetches signed S3 URL and opens in new tab
- Implement loading state (isLoadingUrl) to prevent rapid clicks
- Make filename a clickable link with underline and blue color
- Add error handling that logs to console without crashing
- Show 'wait' cursor during URL fetch
- Browser handles file display based on Content-Type (PDF viewer, image display, audio player)
2026-02-05 19:48:11 +05:30
Nuwan 38fea32f22 docs(14-01): complete attachment message display plan
Tasks completed: 2/2
- Task 1: WebSocket transformation with attachment fields
- Task 2: JKChatMessage attachment rendering

SUMMARY: .planning/phases/14-chat-integration-and-display/14-01-SUMMARY.md
2026-02-05 19:45:28 +05:30
Nuwan b8bfd23a9c feat(14-01): render attachment messages with distinct styling and metadata
- Import formatFileSize from attachmentValidation service
- Add isAttachmentMessage helper to detect attachment messages
- Render attachment messages with light blue background (#e3f2fd)
- Display paperclip icon with accessible aria-label
- Show '[name] attached [filename]' format with file size if available
- Update PropTypes to include optional attachment fields
- Maintain React.memo for performance
2026-02-05 19:43:46 +05:30
Nuwan 6d1cf489d7 feat(14-01): extend WebSocket message transformation for attachment fields
- Add attachment fields to CHAT_MESSAGE handler transformation
- Include attachmentId, attachmentName, attachmentType, purpose, attachmentSize
- Fields null/undefined for regular text messages
- WebSocket payload maps to Redux format with attachment metadata
2026-02-05 19:43:36 +05:30
Nuwan 5ed8b3d0ad fix(14): revise plans based on checker feedback
Addresses 3 blockers and 2 warnings:

BLOCKER 1: Plan 02 now depends on Plan 01 (wave: 2, depends_on: ["14-01"])
BLOCKER 2: Task 1 in Plan 02 now verifies existing getMusicNotationUrl
           instead of creating it; rest.js removed from files_modified
BLOCKER 3: Plan 01 Task 2 adds explicit TDD exception justification
           (styling-only change per CLAUDE.md)

WARNING 1: Plan 02 keeps autonomous: false with comment explaining
           checkpoint is for download flow verification
WARNING 2: Plan 01 must_haves.truths now includes edge case validation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 19:21:51 +05:30
Nuwan 68229dd003 docs(14): create phase plan for Chat Integration & Display
Phase 14: Chat Integration & Display
- 2 plan(s) in 1 wave(s)
- 2 parallel (wave 1), 0 sequential
- Extends JKChatMessage for attachment display
- Adds clickable links with signed URL fetching
- Human verification checkpoint in plan 02
- Ready for execution
2026-02-05 19:16:42 +05:30
Nuwan 45e284096a docs(13): complete File Upload Infrastructure phase
- Mark all 3 plans complete (validation, Redux state, UI integration)
- Update phase status: Complete (2026-02-05)
- Mark 8 requirements as Complete (REQ-1.1-1.4, REQ-6.1-6.3, REQ-7.1)
- Phase verification: 14/14 must-haves verified (100%)
- User verified: file upload working end-to-end with backend 201 Created
2026-02-05 19:04:17 +05:30
Nuwan e28a4df876 docs(13-03): document bug fixes found during verification
Added deviations section documenting 2 auto-fixed bugs:
1. ESLint no-unused-expressions (optional chaining)
2. Duplicate /api/ prefix in REST endpoint URL

Both bugs found and fixed during user verification (Task 4).
2026-02-05 18:59:39 +05:30
Nuwan ff6042e884 docs(13-03): complete file upload UI integration plan
Tasks completed: 3/3
- Wire up Attach button in session toolbar
- Create upload progress component for chat window
- Display upload progress in chat message list

User verification: APPROVED
- File dialog opens on button click
- Invalid files rejected with error toast
- Valid files upload to backend (201 Created)
- Upload progress displayed in chat

SUMMARY: .planning/phases/13-file-upload-infrastructure/13-03-SUMMARY.md
2026-02-05 18:58:49 +05:30
Nuwan b1ed2247ba fix(13-03): correct API endpoint URL for music notation upload
Remove duplicate /api/ prefix - REACT_APP_API_BASE_URL already includes /api.
Fixed: /api/api/music_notations -> /api/music_notations
2026-02-05 11:42:56 +05:30
Nuwan edf74f7248 fix(13-03): resolve ESLint no-unused-expressions errors
Replace optional chaining expressions with explicit if checks to satisfy ESLint configuration.
2026-02-05 11:38:28 +05:30
Nuwan f2c07faede feat(13-03): display upload progress in chat message list
- Import selectIsUploading and selectUploadFileName from sessionChatSlice
- Import JKChatUploadProgress component
- Add useSelector hooks for upload state (isUploading, uploadFileName)
- Render JKChatUploadProgress at end of message list when upload in progress
- Upload indicator appears at bottom of chat for easy visibility
- Conditional rendering: only shows when isUploading is true AND fileName exists
2026-02-05 11:06:50 +05:30
Nuwan cd2d79b190 feat(13-03): create upload progress component for chat window
- Create JKChatUploadProgress component with Spinner and filename display
- Styled as system message (gray background, italic text)
- Display format: 'Uploading [filename]...'
- Uses React.memo for performance optimization
- PropTypes validation for fileName (required)
- 42 lines including component, styles, and PropTypes
2026-02-05 11:06:44 +05:30
Nuwan 7455e2ec28 feat(13-03): wire up Attach button in session toolbar
- Add imports for uploadAttachment, validation, and upload state selectors
- Add attachFileInputRef for hidden file input element
- Add handleAttachClick to trigger file dialog
- Add handleFileSelect with validateFile pre-upload validation
- Add useEffect to display upload error toasts
- Add hidden file input with accept attribute for valid file types
- Update Attach button with onClick handler and disabled state during upload
- Button shows 'Uploading...' text when upload is in progress
- Chat window opens automatically when upload starts
- File validation prevents invalid uploads (size/type) with immediate error feedback
2026-02-05 11:06:39 +05:30
Nuwan 765fcba8fe docs(13-02): complete phase plan with summary and state updates
Tasks completed: 1/1
- Redux upload state management and REST helpers with TDD

SUMMARY: .planning/phases/13-file-upload-infrastructure/13-02-SUMMARY.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 11:02:47 +05:30
Nuwan 3dfbb57eaf docs(13-01): complete file validation service plan
Tasks completed: 1/1
- File validation service with TDD methodology
- 37 tests passing, 100% coverage
- All 5 functions implemented and documented

SUMMARY: .planning/phases/13-file-upload-infrastructure/13-01-SUMMARY.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 11:01:45 +05:30
Nuwan 3b52b58cc5 feat(13-02): add Redux upload state and REST helpers
- Add uploadState to sessionChatSlice initialState
- Implement setUploadStatus and clearUploadError reducers
- Create uploadAttachment async thunk with error handling
- Add 5 upload selectors (status, error, progress, fileName, isUploading)
- Implement uploadMusicNotation using native fetch (NOT apiFetch)
- Implement getMusicNotationUrl using apiFetch
- Add comprehensive unit tests for all upload functionality

TDD: RED-GREEN cycle complete
Tests: 85/88 passing (3 pre-existing failures unrelated to upload)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 11:00:58 +05:30
Nuwan 878e9e44aa feat(13-01): implement attachment validation service
GREEN phase - TDD cycle
- validateFileSize: checks 10 MB limit, customizable
- validateFileType: extension whitelist validation
- getAttachmentType: audio vs notation detection
- validateFile: combined validation with backend warnings
- formatFileSize: human-readable display (B/KB/MB)
- All constants exported for component usage

Implementation follows REACT_INTEGRATION_DESIGN.md Section 7
All 37 tests passing (100% coverage)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 10:59:03 +05:30
Nuwan 1eef4d227e test(13-01): add failing tests for attachment validation service
RED phase - TDD cycle
- 15+ test cases covering all 5 functions
- validateFileSize: size limits and edge cases
- validateFileType: extension whitelist and case handling
- getAttachmentType: audio vs notation detection
- validateFile: combined validation with warnings
- formatFileSize: human-readable formatting
- Constants validation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 10:58:30 +05:30
Nuwan a8ec4e3a88 fix(13): revise plans based on checker feedback
Phase 13: File Upload Infrastructure
- Plan 13-01: Reframe truths as user-observable outcomes
- Plan 13-02: Reframe truths as user-observable outcomes
- Plan 13-03: Move Attach button from chat composer to session toolbar per REQ-1.1
- Plan 13-03: Add upload progress display in chat window per REQ-1.4
- Plan 13-03: Update file list to reflect actual files modified

Blockers addressed:
- REQ-1.1 location: Button now goes in JKSessionScreen toolbar (not JKChatComposer)
- Upload display: Added JKChatUploadProgress component and integration

Warnings addressed:
- must_haves.truths now describe user experience, not implementation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 10:43:57 +05:30
Nuwan 451138bbb8 docs(13): create phase plan for File Upload Infrastructure
Phase 13: File Upload Infrastructure
- 3 plan(s) in 2 wave(s)
- 2 parallel (13-01, 13-02 in Wave 1), 1 sequential (13-03 in Wave 2)
- Ready for execution

Plan structure:
- 13-01: TDD - Attachment validation service (validateFileSize, validateFileType, getAttachmentType)
- 13-02: TDD - Redux upload state and REST helpers (uploadAttachment thunk, uploadMusicNotation)
- 13-03: Attach button integration (JKChatAttachButton + JKChatComposer + human verification)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 10:38:31 +05:30
Nuwan 15f0e45668 docs(12): complete Attachment Research & Backend Validation phase 2026-02-02 19:06:21 +05:30
Nuwan 8ef1c8df7e docs(12-02): complete phase plan with summary and state updates
- Created 12-02-SUMMARY.md documenting backend validation and React design
- Updated STATE.md: Phase 12 complete (2/2 plans), 20% v1.2 progress
- Documented 5 key decisions (FormData, size limits, single file, etc.)
- Identified mp3 format support blocker (MEDIUM - decision needed)
- Next steps: Phase 13 implementation ready to begin

Phase 12 summary: Backend 95% ready, React integration fully designed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 19:01:09 +05:30
Nuwan 3ef75d06ad docs(12-01): complete attachment research and API documentation
Tasks completed: 2/2
- Task 1: Document legacy AttachmentStore implementation
- Task 2: Document backend API contract

SUMMARY: .planning/phases/12-attachment-research-&-backend-validation/12-01-SUMMARY.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 19:00:17 +05:30
Nuwan db12cb2f76 docs(12-02): design React integration strategy for attachments
- Designed 7 component modifications with code examples
- Created uploadAttachment Redux thunk with upload state
- Defined REST helpers for upload/download (FormData handling)
- Documented WebSocket handler updates for attachment fields
- Provided complete JKChatAttachButton and JKChatMessage implementations
- Created attachmentValidation.js service with size/type checks
- Mapped all requirements to Phase 13-16 implementation sequence

REACT_INTEGRATION_DESIGN.md: 1319 lines

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 18:57:57 +05:30
Nuwan 7174d9a6d2 docs(12-01): document backend API contract for attachments
- Complete API reference for all three endpoints (POST/GET/DELETE)
- Request/response formats with JSON examples
- File validation rules (extensions, size limits)
- ChatMessage integration and WebSocket broadcast
- S3 storage details and signed URL expiration
- Authentication/authorization patterns
- Error handling with HTTP status codes
- Complete React implementation examples
- curl examples for all endpoints
- 1119 lines with comprehensive coverage

ATTACHMENT_API.md: .planning/phases/12-attachment-research-&-backend-validation/docs/ATTACHMENT_API.md
2026-02-02 18:57:45 +05:30
Nuwan 48ff1dfbb1 docs(12-01): document legacy AttachmentStore implementation
- Comprehensive analysis of CoffeeScript Reflux store patterns
- Upload flow breakdown with FormData construction
- Client-side validation logic (10 MB limit)
- Hidden file input trigger pattern
- Error handling for 413/422 responses
- Integration points with ChatStore and dialog system
- React port patterns and implementation checklist
- 538 lines, 42 code examples

ATTACHMENT_LEGACY.md: .planning/phases/12-attachment-research-&-backend-validation/docs/ATTACHMENT_LEGACY.md
2026-02-02 18:54:43 +05:30
Nuwan ec0607a1d4 docs(12-02): validate backend infrastructure for attachments
- Validated MusicNotation model with S3/CarrierWave integration
- Documented REST endpoints (upload, download, delete)
- Confirmed WebSocket attachment metadata fields
- Identified file type mismatch: mp3 in requirements but not backend
- Backend is 95% ready - only mp3 support decision pending

BACKEND_VALIDATION.md: 547 lines

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 18:54:27 +05:30
Nuwan 62f16edfdf docs(12): create phase plan
Phase 12: Attachment Research & Backend Validation
- 2 plan(s) in 1 wave(s)
- 2 parallel, 0 sequential
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:47:14 +05:30
Nuwan a49c133353 docs(12): research phase domain
Phase 12: Attachment Research & Backend Validation
- Backend API contract documented (MusicNotation endpoints)
- MusicNotation model capabilities validated (S3, CarrierWave)
- Legacy AttachmentStore upload flow analyzed
- Integration points identified (chat composer, message display, WebSocket)
- File validation patterns documented (10MB limit, type whitelist)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 18:43:20 +05:30
Nuwan 631253d3f7 docs(roadmap): add v1.2 Session Attachments milestone
Add comprehensive roadmap for file attachment feature:
- Update PROJECT.md with v1.2 milestone and requirements
- Create REQUIREMENTS.md with 24 requirements across 7 categories
- Add Phases 12-16 to ROADMAP.md (5 phases, 10 plans)
- Update STATE.md with milestone v1.2 status

Phases:
- Phase 12: Attachment Research & Backend Validation (2 plans)
- Phase 13: File Upload Infrastructure (3 plans)
- Phase 14: Chat Integration & Display (2 plans)
- Phase 15: Real-time Synchronization (1 plan)
- Phase 16: Attachment Finalization (2 plans)

Coverage: 24/24 requirements mapped (100%)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 18:38:34 +05:30
Nuwan 961c0e36bb chore: update debug logging and test storage state
Changes:
- .gitignore: Add .run-claude.sh to ignored files
- JKSessionScreen.js: Add "-DEBUG-" prefix to console logs for easier filtering
- user1.json, user2.json: Update test authentication state
- 11-VERIFICATION.md: Add verification document for Phase 11

These are maintenance updates from chat feature development and testing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 17:26:16 +05:30
Nuwan 87d24f6ca1 docs: update handoff with chat pause and profile modal TODO 2026-02-02 17:22:53 +05:30
Nuwan 010cf55302 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 <noreply@anthropic.com>
2026-02-02 10:13:14 +05:30
Nuwan 332ae61ba0 fix: implement legacy profile guard behavior (redirect to home)
Based on legacy app (web/app/assets/javascripts/wizard/gear_utils.js):

When canPlayWithOthers() fails (single-player profile detected):
- Legacy app shows dialog with options:
  * Create private session → redirects to new session
  * Go to audio settings → redirects to /account/audio
  * Cancel → redirects to home

Current implementation (without dialog):
- Reject with error.controlled_location = false
- Redirect to home (/client) when profile check fails
- Prevents user from joining with inadequate audio profile

This matches legacy behavior of kicking user back to home, but
WITHOUT the dialog that explains why or offers alternatives.

TODO: Add JKSessionProfileDialog component with same options as
legacy 'single-player-profile-dialog' for better UX.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 10:04:26 +05:30
Nuwan cff2c04732 fix: add AlertCallback alias and proper error in profile guard
Two fixes for built-in audio profile issues:

1. Add JK.AlertCallback as alias for JK.HandleAlertCallback
   - Native client calls default "JK.AlertCallback" before
     SessionSetAlertCallback is registered
   - Now both callback names point to same handler
   - Added logging for alert code 40 (audio profile issues)

2. Provide proper error when guardAgainstSinglePlayerProfile fails
   - Was calling reject() with no parameter (error = undefined)
   - Now creates Error object with message and canPlayResult data
   - Fixes "User profile is not appropriate for session: undefined"

These issues manifest with MacBook built-in mic/speakers when the
profile check fails canPlayWithOthers(), causing tracks to not
display because session guards don't pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 09:27:16 +05:30
Nuwan 970bbe3eb4 fix: await GetClientID() and add safe navigation for error handling
Two bugs fixed:

1. Missing await for GetClientID() in leaveSessionRest
   - jamClient.GetClientID() returns a Promise
   - Was passed unresolved to deleteParticipant(), causing
     DELETE /api/participants/[object Promise] 404 error
   - Now properly awaited before use

2. Unsafe property access on error object
   - error.controlled_location accessed without null check
   - Changed to error?.controlled_location (optional chaining)
   - Prevents "Cannot read properties of undefined" error

These issues manifested when using MacBook Pro built-in mic/speakers
instead of Scarlet audio interface, likely due to different
initialization timing or missing audio profile causing error paths.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 08:42:32 +05:30
Nuwan c4cc80e967 debug: add console logging for WebSocket chat message debugging 2026-02-02 08:02:41 +05:30
Nuwan 5132c83458 fix: pass client_id to exclude sender from WebSocket broadcast
The backend uses client_id to identify the sender and exclude them
from receiving their own message via WebSocket (avoiding duplication
with optimistic update).

Changes:
- rest.js: Add clientId parameter to sendChatMessage
- sessionChatSlice.js: Pass clientId to API call
- JKChatComposer.js: Get server.clientId from context and pass it

This fixes: Messages now broadcast to OTHER users in session, not
just the sender. The sender sees optimistic update immediately, other
users receive via WebSocket.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 22:16:01 +05:30