pediatric-ai-scribe-v3/src/utils
Daniel bf4f895f2c
Some checks failed
Forgejo Android APK / Root app tests (push) Successful in 47s
Forgejo Docker Build / Root app tests (push) Successful in 49s
Forgejo Android APK / Build signed APK (push) Successful in 1m55s
Forgejo Docker Build / Build Docker image (push) Successful in 9s
Forgejo Docker Build / Deploy to the host (push) Failing after 0s
fix: article uploads are 10 MB, type-checked both ways, and sniffed
The ceiling was 100 MB per file with ten files allowed at once, and every file
is held whole in memory to be parsed — so the old limit let a single request ask
for a gigabyte of heap. A source article that size is not a thing anyone
uploads here. Now 10 MB, defined once and used by both the multer limit and the
post-upload check.

The filter accepted `allowed mime OR allowed extension`, so naming a file .pdf
was enough on its own, whatever it declared — and the extension is chosen by
whoever uploads. Both are required now.

Neither of those sees any bytes: multer filters on the headers, before the file
has arrived. verifySources() runs once the buffer exists and refuses a file
whose contents are not what its type claims, using the same helper as documents,
S3 uploads and assistant attachments. It runs before extraction, because an
extractor handed a malformed file is where the damage would happen.

The CMS screen said 100 MB and listed four of the ten accepted formats; it now
says what the server actually does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
2026-09-12 19:25:41 +02:00
..
adminLockdown.js feat: admin lockdown, so several admins do not all get to change everything 2026-09-10 23:20:29 +02:00
ai.js refactor: Google models go through LiteLLM; the Vertex SDK is gone 2026-09-11 13:51:22 +02:00
audioBackupStore.js refactor: one place decides which bucket, on which S3, with which credentials 2026-09-10 17:09:13 +02:00
auditQueue.js Batch of security + scale fixes 2026-04-14 05:24:40 +02:00
buildId.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
citationAudit.js fix: recordings that produced nothing, and the boxes that zoomed on iOS 2026-09-11 00:16:19 +02:00
clinicalAnswer.js fix: a second deck reused the first deck's pictures 2026-09-12 08:26:09 +02:00
clinicalConversation.js fix: an assistant attachment must be the image type it claims to be 2026-09-12 19:00:10 +02:00
clinicalMcpClient.js refactor: ped-ai calls clinical_semantic_search only 2026-09-10 17:22:40 +02:00
clinicalPromptPool.js feat: improve clinical assistant prompts 2026-06-06 00:01:07 +02:00
clinicalPrompts.js fix: mobile layout regression, workspace menu in the assistant rail, prompt as principles 2026-09-09 22:24:10 +02:00
clinicalRetrieval.js refactor: retrieval is text-only; admins can add model ids discovery never returns 2026-09-09 23:35:06 +02:00
clinicalTranslation.js fix: translated answers keep their source chips; the patient take home can be translated 2026-09-09 18:40:23 +02:00
config.js Feat: admin CMS, save/resume encounters, user templates, SSHADESS, well visit notes, sick visit, ROS/PE checklists, ICD-10 diagnoses 2026-03-22 16:43:39 -04:00
crypto.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
deckBuild.js fix: a second deck reused the first deck's pictures 2026-09-12 08:26:09 +02:00
deckReview.js feat: modifying a deck can see it 2026-09-12 06:55:16 +02:00
deckSchema.js fix: an assistant attachment must be the image type it claims to be 2026-09-12 19:00:10 +02:00
docSpec.js feat: a slide can be drawn from primitives when the named layouts have no word for it 2026-09-11 22:12:26 +02:00
documentExport.js feat: a slide can be drawn from primitives when the named layouts have no word for it 2026-09-11 22:12:26 +02:00
embeddings.js fix: article uploads are 10 MB, type-checked both ways, and sniffed 2026-09-12 19:25:41 +02:00
errors.js harden logging and observability 2026-05-08 19:08:19 +02:00
extensionTransfer.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
fileLog.js fix: a second deck reused the first deck's pictures 2026-09-12 08:26:09 +02:00
fileType.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
generatedImageLinks.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
generatedImages.js feat: image fallback chains for every workflow, and a library worth looking at 2026-09-12 14:53:04 +02:00
generatedImageStorage.js feat: an image library — every picture this account has made 2026-09-12 14:36:30 +02:00
generationOptions.js Send reasoning options only to supported model 2026-08-27 21:25:38 +02:00
imageTool.js fix: a second deck reused the first deck's pictures 2026-09-12 08:26:09 +02:00
learningRetrieval.js feat: Learning resources can be grounded in the clinical corpus 2026-09-11 14:03:05 +02:00
litellm.js feat: a text-only model can ask a model that can see; and the image regex is gone 2026-09-12 15:43:36 +02:00
logger.js fix: a second deck reused the first deck's pictures 2026-09-12 08:26:09 +02:00
loginCodes.js feat: sign in with a code emailed to you, offered beside the password 2026-09-11 20:12:03 +02:00
metrics.js fix: generation stopped working whenever the slide reviewer was switched off 2026-09-12 00:57:30 +02:00
models.js refactor: Google models go through LiteLLM; the Vertex SDK is gone 2026-09-11 13:51:22 +02:00
modelVision.js feat: a text-only model can ask a model that can see; and the image regex is gone 2026-09-12 15:43:36 +02:00
notify.js Add biometric auth, ntfy push notifications, mobile improvements 2026-04-11 02:35:07 +02:00
objectStorage.js refactor: one place decides which bucket, on which S3, with which credentials 2026-09-10 17:09:13 +02:00
passwords.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
patientTakehome.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
platform.js Sliding 24h idle timeout (web) + persistent mobile + 2FA backup codes 2026-04-14 04:24:54 +02:00
policy.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
promptCatalog.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
promptRevisions.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
prompts.js feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
promptSafe.js Batch of security + scale fixes 2026-04-14 05:24:40 +02:00
pubmedSearch.js feat: My Resources says what it is, offers its sources in one place, and Modify gets them too 2026-09-11 18:54:17 +02:00
redact.js harden logging and observability 2026-05-08 19:08:19 +02:00
redis.js feat: improve clinical assistant prompts 2026-06-06 00:01:07 +02:00
registrationInvites.js fix: expired invitations can be cleared too, revoked ones still cannot 2026-09-11 20:41:18 +02:00
resourceImages.js fix: a second deck reused the first deck's pictures 2026-09-12 08:26:09 +02:00
sessions.js Add node-pg-migrate for versioned schema changes + better mobile UA labels 2026-04-14 05:06:19 +02:00
slideShapes.js feat: record what a deck wanted and could not have 2026-09-11 22:51:15 +02:00
slideSpec.js fix: decks were falling back to markdown, so no figure could ever be requested 2026-09-12 04:21:20 +02:00
sttProvider.js fix: patch nodemailer; Settings offers STT models the gateway really has 2026-09-10 15:54:57 +02:00
ttsProvider.js chore: Kitten and Supertonic retired; Kokoro is the local voice 2026-09-12 16:45:05 +02:00
urlSafety.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
visionTool.js fix: the active library view is unmistakable, and a leading question cannot mislead the vision model 2026-09-12 16:27:21 +02:00
webSearch.js feat: PubMed search for My Resources, and an image tool that actually fires 2026-09-11 16:47:08 +02:00