Click-to-listen on the live wall + HTTP Range on /media (#233) #253
No Reviewers
Labels
Clear labels
area/ai-pipeline
area/auth
area/billing
area/correlation
area/discord
area/frontend
area/governance
area/growth
area/infra-deploy
area/legal
area/map
area/mqtt
area/node-ota
area/osint
area/recording-audio
area/sdr-radio
area/transcription
board
board:agenda
minutes:draft
minutes:final
role:ceo
role:cfo
role:cio
role:ciso
role:cmo
role:coo
role:cto
Scene/entity extraction, summarizer, AI providers, embeddings
AuthN/Z, roles, tenancy/org scoping, API keys, credentials
Plans, entitlements, AI spend accounting and caps
Incident correlation, linking, lifecycle, severity, corr_debug
Discord bot, radio bots, voice streams, bot tokens, webhooks
Web UI: Next.js app and the edge-node local dashboard
Board process, minutes, unattended runner, agent tooling
Go-to-market, outreach, cold email, discovery conversations
CI/CD, VM, registry, Firestore rules/indexes deploy, Terraform/Caddy
ToS, retention, licences/DAAs, CAN-SPAM, E&O, name suppression
Live map: pins, paths, tiles, legend, geocoding
Node-C2 MQTT, checkins, commands, node sweeper, dynsec
Node install, enrollment, OTA updater, image skew
External feeds: cameras, 511, ADS-B, AIS, outages, and their licences
Call capture, boundaries, PulseAudio, ring buffer, trimming, attribution
OP25 decode, SDR hardware/tuning, conventional, second SDR, mesh radio
STT, transcript correction, place verification, name accuracy
Board process: minutes and board-filed items
Needs board scoping at the next sitting; CEO removes the label once scoped
One exec pre-read, closed by CEO
CEO ruling; open until enacted
Filed by the CEO
Filed by the CFO
Filed by the CIO
Filed by the CISO
Filed by the CMO
Filed by the COO
Filed by the CTO
kind
behavior-bug
Wrong product behavior; the instrument reads it correctly
kind
measurement-bug
Corrupts the recording/instrument (debug data, evals, health checks), not behavior
priority
p0
Drop everything: prod broken, live exposure, or owner-ruled P0
priority
p1
Next up: blocks a gate, a customer, or core incident quality
priority
p2
Normal: real defect or planned work, schedule in turn
priority
p3
Low: minor, cosmetic, or someday
status
blocked
Waiting on an external party, spend, or another issue
status
in-progress
Branch or PR open against it
status
needs-decision
Waiting on an owner or board ruling before work
status
needs-info
Root cause or repro unknown; needs a reading first
type
bug
Something built is wrong: code, data, or a measurement
type
chore
Maintenance, refactor, tests, pinning, cleanup: no user-visible change
type
decision
A ruling to make or record: board minutes, owner calls, legal reviews
type
docs
Docs, runbooks, CLAUDE.md, skills, SOPs
type
feature
New capability or an extension of an existing one
type
security
Security, privacy, credential or tenant-isolation exposure
type
tracking
Tracker, checklist, initiative or punch-list spanning several changes
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: logan/server-26#253
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #233
What changed
Backend:
routers/media.py+internal/storage.py/media/calls/{id}/audio: a singlebytes=a-b/bytes=a-/bytes=-nreturns 206 withContent-Range,Content-LengthandAccept-Ranges: bytes. An unsatisfiable range returns 416 (Content-Range: bytes */size). No Range returns 200 with the full body andAccept-Ranges: bytes. A multi-range, non-bytesor malformed header is ignored and gets a 200, which RFC 9110 permits.audio_object_size()(blob.reload()) anddownload_audio_range()(download_as_bytes(start=, end=), in a thread) read only the requested bytes. The body is aStreamingResponsemade of 512 KiB span reads. The first span is fetched before headers go out, so a read failure is still a clean 404.verify_audio_link) and the Firestore lookup are unchanged and still run first. A bad signature returns 403 before any Firestore or GCS call (tested).Content-Typeis stillcontent_type_for(gcs_uri).Cache-Controlis unchanged. The comment that cited DEFERRED.md is replaced.storage.download_audio()is now unused. I left it in place.Frontend
components/InlinePlayer.tsx(new):InlinePlayermoved out ofCallSpineEntry.tsxand exported, plus a smallerPlayButton.CallSpineEntryimports it.lib/audioQueue.ts(new): auseSyncExternalStorestore over one module-level<audio>element, so only one call plays at a time anywhere. Actions:play(callId),playIncident(idsOldestFirst),stop(), pluspause,resume,seekandtoggle. Components subscribe to primitive slices only, so the map does not re-render ontimeupdate. The playback URL is minted per play throughGET /calls/{id}, as before. Audio stops when the last player unmounts.WallPanels.tsxIncidentPanel: a play button on each spine row that has audio, and a Play incident button that queues the loaded calls oldest first (it changes to Stop while one is playing). The playing row is highlighted and grows a seek bar.slice(0, 30)now shows "Showing latest 30 of M" (M = max(call_ids, loaded)) with a "show all loaded" toggle. Whencall_ids> loaded, it says how many older calls are outside the loaded window. #239's other items (per-incident fetch, the scrubber, the#inc=fallback) are not in this PR.MapView.tsx: a play button in each path-stop popup (MachineOutputNotice kept), and "play latest" on rail cards, placed as a sibling of the card because a button cannot nest inside a button. The path stop whose call is playing gets an accent ring and is raised above the other markers.canPlayAudio()inlib/audioQueue.ts. It is true for any signed-in org member (or platform admin) today. Its comment points at BUSINESS_MODEL.md §3 / Gate A so the Public tier can be switched off in that one place. I did not add a tier concept.#109 item 2 (conditional hook)
This was already fixed on main. The pre-move
InlinePlayerhad nohasAudioprop or guard, and its only early return (if (error)) came after every hook. No change was needed. The new components keep every hook before any return.Not touched
call_recorder,metadata_watcheror upload.LiveView.tsx,c2api.ts,types.ts,main.py,config.py, the discord files.Verification
pytestin drb-c2-core: 778 passed, including the newtests/test_media_range.py(21 tests). It covers bounded, open-ended and suffix ranges, end clamping, 416, the no-Range 200, ignored headers, a 13 MB object streamed in spans of 512 KiB or less (only the requested bytes are read), 403 before any lookup for a bad or expired signature, 404 for a missing object, the legacy.mp3content type, and the storage helpers callingreload()anddownload_as_bytes(start=, end=)and never a whole-object read.tsc --noEmit: exit 0./mediarequest as 206.🤖 Generated with Claude Code
Backend: /media/calls/{id}/audio now honours a single HTTP Range (bytes=a-b, a-, -n) with 206 + Content-Range, 416 for unsatisfiable, and a 200 full body (Accept-Ranges: bytes) otherwise. The body is streamed from GCS in 512 KiB span reads (storage.audio_object_size + download_audio_range) instead of downloading the whole object first, so a 600 s FLAC starts after one span and seeks fetch only what they need. HMAC check and Firestore lookup unchanged and still first. Frontend: InlinePlayer moved to components/InlinePlayer.tsx and now drives lib/audioQueue.ts, a useSyncExternalStore store over ONE audio element (one call plays at a time). Wall spine rows get play buttons and a "Play incident" queue (oldest first) with the playing row highlighted; map path-stop popups get a play button and the playing stop gets an accent ring; rail cards get "play latest". Playback is gated by canPlayAudio() (BUSINESS_MODEL section 3 / Gate A hook). Nothing plays until clicked. Spine truncation is now stated ("showing latest 30 of M", show-all toggle, count outside the loaded window) for server-26#239. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>