Skip to content

Release: Play after edit, WhatsApp, stream labels S1/S2/S3, sortable streams#8

Merged
jerryagenyi merged 2 commits intomainfrom
dev
Feb 2, 2026
Merged

Release: Play after edit, WhatsApp, stream labels S1/S2/S3, sortable streams#8
jerryagenyi merged 2 commits intomainfrom
dev

Conversation

@jerryagenyi
Copy link
Copy Markdown
Owner

@jerryagenyi jerryagenyi commented Feb 2, 2026

Summary

  • Play after device change — Play proxy checks Icecast response status; non-200 returns 502 with a clear message so the listener page no longer shows "Authentication Failed". Listener page shows "Stream not running. Start it on the dashboard, then try Play again." 10s timeout, try/catch for upstream.resume(), res.headersSent guard. TROUBLESHOOTING.md §1c updated.
  • Stream labels S1/S2/S3 — getStats() returns streams in persisted order with label; listener page and dashboard show label (e.g. S1 — Stream Name).
  • Sortable streams — Up/down buttons on dashboard; POST /api/streams/reorder; order persisted in config/streams.json (_order); setStreamOrder() deduplicates IDs. Listener page uses same order.
  • Contact WhatsApp — Country code enforced (digits 10–15, no leading zero); isValidWhatsApp(); wa.me link built from digits only; ContactManager validation and placeholder.
  • TODO.md — Stability, device-change, labels, sortable, WhatsApp marked done.

Follow-up to deep review: play proxy timeout and double-response guard; stream order deduplication.

Summary by CodeRabbit

Release Notes

  • New Features

    • Stream reordering: Move streams up or down with new controls; order persists automatically.
    • Stream labeling: Streams display with server-ordered labels (S1, S2, S3) across dashboard and listener pages.
    • Enhanced WhatsApp validation requiring country code format with no leading zero.
  • Bug Fixes

    • Play failures now display clearer messaging ("Stream not running") instead of generic errors.
    • Device changes mid-stream no longer require page refresh or stream recreation.

- Add 10s timeout to play proxy to prevent hanging on Icecast issues
- Wrap upstream.resume() in try/catch for error resilience
- Add res.headersSent guard to prevent double responses
- Deduplicate streamIds in setStreamOrder() to prevent duplicates

Follow-up to deep review feedback.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

Adds stream reordering capability via new API endpoint and UI controls, improves stream playback error messages to show "Stream not running" instead of authentication errors, refines WhatsApp validation to enforce country codes without leading zeros, and updates TODO items with implementation details.

Changes

Cohort / File(s) Summary
Stream Reordering System
public/components/FFmpegStreamsManager.js, src/routes/streams.js, src/services/StreamingService.js, tests/integration/stream-reorder.test.js
Added moveStreamUp/moveStreamDown/reorderStreams methods to client-side stream manager; implemented POST /api/streams/reorder endpoint with validation; introduced streamOrder array in StreamingService to persist and enforce stream ordering in config/streams.json; added S1/S2/S3 labels to display ordered stream positions.
WhatsApp Validation Enhancement
public/components/ContactManager.js, src/routes/contact.js
Simplified WhatsApp validation logic to strip non-digits, enforce 10–15 digit length, and disallow leading zeros; updated error messaging and UI placeholder to specify country code requirement; added isValidWhatsApp helper function.
UI & Error Message Updates
public/streams.html, docs/TROUBLESHOOTING.md
Changed playback error messages from "Network/Server not available" to "Stream not running. Start it on the dashboard, then try Play again."; updated troubleshooting guide section title and steps to reflect new proxy behavior; added conditional WhatsApp link rendering based on valid digit extraction.
Configuration & Documentation
.claude/settings.local.json, TODO.md
Added "Bash(git rebase:\*)" permission to allowed commands; converted multiple TODO items to completed status with detailed implementation notes, including stream labeling, reordering endpoint persistence, and WhatsApp validation rules.

Sequence Diagram

sequenceDiagram
    participant Client as Client (UI)
    participant API as POST /api/streams/reorder
    participant Service as StreamingService
    participant Storage as streams.json

    Client->>API: POST with streamIds array
    activate API
    API->>API: Validate streamIds is array
    alt Valid
        API->>Service: setStreamOrder(streamIds)
        activate Service
        Service->>Service: Update streamOrder array
        Service->>Storage: Save _order field to config
        activate Storage
        Storage-->>Service: Persisted
        deactivate Storage
        Service-->>API: Success
        deactivate Service
        API-->>Client: 200 response with updated order
    else Invalid
        API-->>Client: 400 Bad Request
    end
    deactivate API
    Client->>Client: Re-render with new order & labels
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • PR #3: Modifies StreamingService, src/routes/streams.js, and UI components for stream-ordering and capacity/diagnostic features—directly overlaps with core reordering logic and service layer changes.
  • PR #6: Updates FFmpegStreamsManager class and streams UI/routes to add serverHost and startAllStreams API—shares common ground in streams component structure and route modifications.

Poem

🐰 Hop, hop! The streams now reorder true,
Labels S1, S2, S3 shine through!
No more cryptic "Auth Failed" blues—
Clear messages guide me, I'm amused,
Organization thrives anew! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main features implemented in the changeset: device/play handling, WhatsApp validation, stream labels, and stream reordering.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jerryagenyi jerryagenyi merged commit 1a47bfa into main Feb 2, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant