Go to file
Nuwan 00e2f9cabd feat(05-jamtrack): implement server-side packaging flow
Implements the missing server-side packaging phase that exists in the
legacy system. JamTracks must be packaged/signed on the server before
they can be downloaded.

**Legacy System Flow (8 states):**
1. initial → 2. packaging → 3. downloading → 4. keying → 5. synchronized

**Previous Implementation (6 states - INCORRECT):**
1. idle → 2. checking → 3. downloading (skipped packaging!)

**New Implementation (7 states - CORRECT):**
1. idle → 2. checking → 3. packaging → 4. downloading → 5. keying → 6. synchronized

Changes:

1. REST API (rest.js):
   - Added enqueueMixdown(packageId) endpoint
   - POST /mixdowns/{packageId}/enqueue

2. Redux State (mediaSlice.js):
   - Added 'packaging' state to downloadState
   - Added packageId, packaging_steps, current_packaging_step, signing_state fields
   - Updated clearDownloadState to reset new fields

3. Download Logic (mediaSlice.js downloadJamTrack thunk):
   - Added packaging phase before download
   - Calls enqueueMixdown API
   - Waits for signing_state === 'SIGNED' (polls Redux state every 500ms)
   - 60 second timeout with clear error messages
   - Only proceeds to download after package is signed

4. WebSocket Handler (useSessionWebSocket.js):
   - Added SUBSCRIBE_NOTIFICATION handler
   - Updates packaging progress: signing_state, packaging_steps, current_packaging_step
   - Handles packaging errors: ERROR, SIGNING_TIMEOUT, QUEUED_TIMEOUT, QUIET_TIMEOUT
   - Logs packaging progress for debugging

5. UI (JKSessionJamTrackPlayer.js):
   - Added packaging state display
   - Shows "Your JamTrack is currently being created in the JamKazam server"
   - Displays signing_state and step progress (X of Y)
   - Shows spinner during packaging
   - Matches legacy system UX

This fixes the critical issue where JamTracks were attempted to be
downloaded without server-side packaging, which would always fail.

The flow now matches the legacy download_jamtrack.js.coffee behavior
documented in .planning/codebase/JAMTRACK_LEGACY.md lines 57-85.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 14:49:15 +05:30
.claude feat(05-jamtrack): implement server-side packaging flow 2026-01-15 14:49:15 +05:30
.planning docs(05-05): complete Error Handling & Final UAT plan 2026-01-15 01:17:53 +05:30
admin Merged in seth/obs-download (pull request #63) 2025-06-15 00:44:11 +00:00
db change database migrations to be natural rails db migrations. 2021-02-13 20:17:18 -06:00
jam-ui feat(05-jamtrack): implement server-side packaging flow 2026-01-15 14:49:15 +05:30
lambda/jamtrack-importer Merged in mc/sluggarize-fixes (pull request #52) 2025-02-09 05:09:54 +00:00
monitor Merge with develop 2015-02-12 14:32:12 -06:00
pb showing incoming text mesages in chat window 2021-10-13 22:51:30 +05:30
ruby fix merge conflict by just having session screen route 2025-09-22 09:10:29 +05:30
web media popup system implementation 2026-01-07 11:55:20 +05:30
websocket-gateway wip 2025-09-30 00:27:48 +05:30
wordpress/plugins Create /downloads-legacy, and update /downloads for the 3 clients 2024-08-11 19:39:56 -05:00
.gitignore remove whitespace 2024-03-18 08:52:18 +05:30
.ruby-version sending weekly email to users about new users joined in 2023-11-02 08:41:29 +05:30
CLAUDE.md updates to CLAUDE.md 2026-01-09 22:00:49 +05:30
atlassian-ide-plugin.xml VRFS-1654 - configure feed layout 2014-05-08 23:18:57 +08:00
bitbucket-pipelines.yml Add GA to landing pages and fix build constant 2025-03-24 22:01:49 -05:00
build build bump 2023-11-02 08:41:35 +05:30
init_data.dump change database migrations to be natural rails db migrations. 2021-02-13 20:17:18 -06:00
resetdb.sh build push 2017-05-26 14:47:37 -05:00
runadmin * adding ability to run everything within jam-web for jobs 2014-01-29 13:26:11 -06:00
runjobs * adding ability to run everything within jam-web for jobs 2014-01-29 13:26:11 -06:00
runtests * adding runtests helper 2014-01-31 12:09:44 -06:00
runweb * forcing a build of develop branch 2014-01-05 00:02:48 +00:00
update VRFS-1651 - decoupling jam_ gems from ENV 2014-05-06 22:57:32 -05:00
update2 a better version of update for scott 2014-03-17 12:53:06 -05:00