pediatric-ai-scribe-v3/test
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
..
account-boundary.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
admin-clinical-assistant-wiring.test.js fix: drop the dead admin jump links; stop a test flake at its source 2026-09-10 15:16:47 +02:00
admin-docs-toc.test.js test docs toc links 2026-05-09 01:33:06 +02:00
assistant-attachment-roundtrip.test.js fix: translated answers keep their source chips; the patient take home can be translated 2026-09-09 18:40:23 +02:00
assistant-autosave.test.js fix: image Done state, chat titles that keep whole words, and readable extension cards 2026-09-10 06:44:22 +02:00
assistant-citation-modal.test.js feat: Open WebUI-style assistant workspace — 3-column layout, markdown/math/code/tables, autosave with images, translation (LibreTranslate+DeepL), citation modal, Learning Hub moved in, handoff removed 2026-09-08 18:52:35 +02:00
assistant-citations.test.js feat: display-only sources toggle, signed-out preview, and a composer that carries the toolbar 2026-09-10 04:12:36 +02:00
assistant-component-css.test.js refactor: drop the "Saved Chats" header and collapse arrow from the rail 2026-09-10 13:27:29 +02:00
assistant-export-owner.test.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
assistant-image-attachments.test.js refactor: the model decides about acknowledgements and images, not route heuristics 2026-09-09 19:06:28 +02:00
assistant-image-done.test.js fix: image Done state, chat titles that keep whole words, and readable extension cards 2026-09-10 06:44:22 +02:00
assistant-image-intent.test.js fix: mobile layout regression, workspace menu in the assistant rail, prompt as principles 2026-09-09 22:24:10 +02:00
assistant-math-mhchem.test.js fix: reviewer findings — mhchem macro wrapping, regenerate history dedupe, strict safe image allowlist, stale docs 2026-09-08 19:25:31 +02:00
assistant-message-actions.test.js fix: send button morphs into a clickable STOP icon while working (no more disabled spinner); grouped bottom-left tools; silent-recording message; completed images auto-join the library; transient image-status retries 2026-09-09 04:12:30 +02:00
assistant-mobile.test.js fix: stop iOS zoom, compact model control, quieter composer, better search 2026-09-10 15:26:43 +02:00
assistant-preview.test.js feat: display-only sources toggle, signed-out preview, and a composer that carries the toolbar 2026-09-10 04:12:36 +02:00
assistant-saved-tables.test.js feat: saved chats grouped by recency, a visible sidebar toggle, and acknowledgements answered cheaply 2026-09-09 18:59:45 +02:00
assistant-sharing-boundary.test.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
assistant-sources-cleaning.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
assistant-translate.test.js fix: translate as HTML so tables and emphasis survive; stop repeat image generation 2026-09-09 18:49:58 +02:00
assistant-user-markdown.test.js feat: Open WebUI-style assistant workspace — 3-column layout, markdown/math/code/tables, autosave with images, translation (LibreTranslate+DeepL), citation modal, Learning Hub moved in, handoff removed 2026-09-08 18:52:35 +02:00
assistant-voice.test.js fix: OWUI-style polish — fullscreen workspace replaces main menu, row-click saved chats (delete stays as hover), markdown-rendered patient handout, admin-only raw transcript, /api TTS URL, scrollable unclipped tables, action buttons hidden in exports, autosave-only copy 2026-09-08 22:41:08 +02:00
assistant-workspace-layout.test.js fix: stop iOS zoom, compact model control, quieter composer, better search 2026-09-10 15:26:43 +02:00
backend-hardening.test.js fix: admin routers authenticate themselves; track the audit in TODO 2026-09-10 16:03:20 +02:00
bedside-respiratory-ventilation.test.js
build-id.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
calc-math.test.js
calculators-data.test.js
clinical-assistant-prompt-pool.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
clinical-conversation.test.js feat: one menu for both views, a slim top bar, and an account card 2026-09-10 04:45:51 +02:00
clinical-generation-options.test.js Send reasoning options only to supported model 2026-08-27 21:25:38 +02:00
clinical-mcp-session-lifecycle.test.js refactor: retrieval is text-only; admins can add model ids discovery never returns 2026-09-09 23:35:06 +02:00
clinical-notes-entrypoints.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
clinical-release-integration.test.js feat: display-only sources toggle, signed-out preview, and a composer that carries the toolbar 2026-09-10 04:12:36 +02:00
clinical-retrieval-title.test.js refactor: retrieval is text-only; admins can add model ids discovery never returns 2026-09-09 23:35:06 +02:00
clinical-table-preservation.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
embeddings-provider.test.js fix litellm metadata model discovery 2026-05-09 04:46:06 +02:00
extension-transfer.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
frontend-prompt-env.test.js feat: display-only sources toggle, signed-out preview, and a composer that carries the toolbar 2026-09-10 04:12:36 +02:00
frontend-rendering-safety.test.js document architecture and harden rendering 2026-05-10 01:07:56 +02:00
generated-image-cache.test.js perf: store real image previews in MinIO, generated at creation and on demand 2026-09-10 06:39:30 +02:00
generated-image-storage.test.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
generated-image-tools.test.js feat: patient take home (copy/export/email), composer mic dictation, voice conversation mode, provider-aware translate languages 2026-09-08 20:01:46 +02:00
generated-images-ui.test.js fix: correct a false Settings claim; make every test child's stdout pure TAP 2026-09-10 15:41:44 +02:00
generated-images.integration.js test: offbox image is session-only in the durable pipeline integration 2026-09-07 16:59:15 +02:00
learning-hub-ai-category.test.js
learning-hub-ai-panel-controller.test.js extract learning hub ai panel controller 2026-05-08 16:54:48 +02:00
learning-hub-editor.test.js extract learning hub ai panel controller 2026-05-08 16:54:48 +02:00
learning-hub-manual-category.test.js fix: make manual CMS category creation visible and keyboard-accessible 2026-09-07 01:16:40 +02:00
learning-hub-quiz-controller.test.js
learning-hub-webdav-controller.test.js
mcp-shutdown.test.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
metrics.test.js fix metrics route normalization 2026-05-08 20:22:14 +02:00
model-defaults.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
module-entrypoints.test.js
notes-sanitize.test.js
patient-takehome.test.js fix: translate as HTML so tables and emphasis survive; stop repeat image generation 2026-09-09 18:49:58 +02:00
pe-guide-data.test.js
policy-flows.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
policy-ui.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
prompt-administration.test.js fix: mobile layout regression, workspace menu in the assistant rail, prompt as principles 2026-09-09 22:24:10 +02:00
release.test.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
session-quiz-ed-regressions.test.js fix: correct a false Settings claim; make every test child's stdout pure TAP 2026-09-10 15:41:44 +02:00
stt-provider.test.js simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00
transcription-memory-policy.test.js feat: keep the screen awake while recording, and keep every recording 24h 2026-09-10 16:42:31 +02:00
tts-provider.test.js Match TTS voices to the selected LiteLLM model 2026-07-30 17:34:34 +02:00
well-visit-data.test.js