pediatric-ai-scribe-v3/public/js
Daniel 523926ab17 feat: keep the screen awake while recording, and keep every recording 24h
Recording
- A screen wake lock is held for as long as a recording runs. Browsers drop
  the lock whenever the page is hidden, so it is taken again on return —
  without that, one glance away ended it for the session. The lock is
  reference counted (two recorders cannot release each other's), never
  requested while hidden (the request would just be rejected), and a denial
  or an unsupported browser leaves the recording running.
- Signing out releases it and stops the recording; nothing is sent, because
  the session that owned the audio is gone.
- start() on an already-running recorder is now a no-op instead of replacing
  the MediaRecorder and silently dropping everything captured so far.
- A recording that ends by itself — recorder error, or the microphone taken
  by another app, unplugged or revoked — takes the same path as pressing
  Stop, so it is transcribed and stored rather than left in a tab that still
  says "recording". Moving around the workspace already kept recording.

Retention
- Every recording is kept for 24 hours now, not only the ones whose
  transcription failed. /api/transcribe already has the audio, so this costs
  no second upload, and a storage failure is logged rather than thrown: it
  must never lose the transcription someone is waiting for.
- One store (src/utils/audioBackupStore.js) is shared by /api/transcribe and
  /api/audio-backups so the two cannot drift. Payload goes to object storage
  when AUDIO_BACKUPS_S3_* is set and to the encrypted Postgres column
  otherwise; metadata always stays in Postgres, so listing, ownership and
  expiry behave the same either way. Object keys are scoped by owner, and
  the expiry sweep deletes the object with the row.

Verified against the live database: round trip byte-identical, another user
reads null, 950 -> 48 bytes compressed, expired rows take their objects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
2026-09-10 16:42:31 +02:00
..
admin fix: image models can be added and offered; solid phone top bar on iOS 2026-09-10 13:46:19 +02:00
assistant perf: cache generated images for the session and decode thumbnails, not originals 2026-09-10 05:20:10 +02:00
bedside allow bedside respiratory without weight 2026-05-08 09:10:33 +02:00
calculators consolidate calculator growth helpers 2026-05-08 04:36:39 +02:00
learningHub feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
notes feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
wellVisit extract well visit schedule data 2026-05-08 05:11:29 +02:00
accountBoundary.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
admin-docs.js docs refresh current workflows 2026-05-09 00:40:45 +02:00
admin.js fix: drop the dead admin jump links; stop a test flake at its source 2026-09-10 15:16:47 +02:00
app.js feat: keep the screen awake while recording, and keep every recording 24h 2026-09-10 16:42:31 +02:00
audioBackup.js feat: export a recording; report a recorder that has silently died 2026-09-10 15:58:58 +02:00
auth.js feat: display-only sources toggle, signed-out preview, and a composer that carries the toolbar 2026-09-10 04:12:36 +02:00
authFetch.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
calc-math.js feat: Bedside clinical reference module + age→weight estimator + dose-math unit tests 2026-04-20 02:49:42 +02:00
calculators.js remove redundant module wrappers 2026-05-08 05:30:32 +02:00
chartReview.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
clinicalAssistant.js fix: stop iOS zoom, compact model control, quieter composer, better search 2026-09-10 15:26:43 +02:00
diagrams.js fix diagram delete confirmation 2026-05-08 06:28:12 +02:00
documents.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
drugs-loader.js convert admin docs and drug loader to modules 2026-05-08 07:50:26 +02:00
e2e-bootstrap.js fix docs toc fallback and remove redundant iifes 2026-05-08 23:08:47 +02:00
ed-encounters.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
encounters.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
extensions.js fix: image Done state, chat titles that keep whole words, and readable extension cards 2026-09-10 06:44:22 +02:00
generatedImages.js perf: store real image previews in MinIO, generated at creation and on demand 2026-09-10 06:39:30 +02:00
hospitalCourse.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
learningHub.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
liveEncounter.js feat: keep the screen awake while recording, and keep every recording 24h 2026-09-10 16:42:31 +02:00
memories.js clarify template-only AI memory context 2026-05-08 07:38:27 +02:00
milestones.js test clinical note entrypoints 2026-05-08 06:33:34 +02:00
milestonesData.js v4: Fix milestones display + add OpenID auth + 100MB PDF support 2026-04-01 17:59:51 +00:00
nextcloud.js convert settings loaders to modules 2026-05-08 07:17:29 +02:00
notes.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
peGuide.js move pe guide data to json 2026-05-08 08:56:21 +02:00
secureStorage.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
shadess.js harden clinical assistant source handling 2026-05-09 19:59:04 +02:00
sickVisit.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
soap.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
speechRecognition.js convert speech helpers to modules 2026-05-08 08:09:38 +02:00
transcriptionSettings.js convert settings helpers to modules 2026-05-08 07:54:08 +02:00
ui-state.js convert settings helpers to modules 2026-05-08 07:54:08 +02:00
voiceDictation.js fix docs toc fallback and remove redundant iifes 2026-05-08 23:08:47 +02:00
voicePreferences.js convert settings helpers to modules 2026-05-08 07:54:08 +02:00
wellVisit.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00