Health Diary Test Pass
Scope: An end-to-end pass over the Health Diary: sending, what happens when it fails, folders, history, voice and caregivers, plus the API checks that the screens cannot show you.
Issue: #2291 · PRs: #2417, #2518 · Time: about 90 minutes for a full pass · Size: 9 sections, 41 cases
Related: Developer guide · Mobile integration · User guide · Product spec
Each case has an id. Report what you find against the id, so a result can be traced back to the check that produced it.
S — Setup
Run the patient app against a backend on the PR branch, using the real API.
| What | How |
|---|---|
| Backend | The PR branch, migrated, with a model key and a Deepgram key in credentials. Redis running. |
| Patient app | VITE_HEALTH_DIARY_MOCK unset or false, so the app talks to the real API. |
| Patient login | Local: john.doe.patient@gmail.com, password in backend/db/seeds/identity/TEST_ACCOUNTS.md. On staging, use a staging patient account instead; the seed accounts exist only on developer machines. |
| Caregiver login | An account that manages at least one dependent (needed for CG). |
| Second patient | Any other patient account (needed for AC-01). |
Getting an API token (for AC)
curl -s -X POST $API/identity/sessions -H 'Content-Type: application/json' -d '{
"user_signin_form": { "email": "<patient email>", "password": "<password>" },
"device_details": { "device_type": "web", "device_token": "qa", "device_version": "1", "device_name": "qa" }
}'
# the response contains data...access_token; send it as:
# -H "Authorization: Bearer <access_token>"A voice request (for AC-03 and AC-04)
curl -s -X POST $API/patient/health-diary/chat/messages/voice \
-H "Authorization: Bearer $TOKEN" \
-F "audio=@note.webm;type=audio/webm" -F "duration_ms=5000" -F "language=ml"SN — Sending a note
The core loop. Your words are saved first, then answered, and every answer carries the disclaimer and a route to care.
SN-01 — The diary opens ready to use
- Click Health Diary in the sidebar.
Expect The chat pane shows the starter suggestions Fever, Headache, Stomach pain, Can't sleep. The folder strip shows General Health, Diabetes, Back Pain and Personal Notes.
SN-02 — A note is answered, with the disclaimer last
- Type
I have had a headache since Tuesday. - Press Send.
Expect Your message appears at once, then a typing indicator. An answer arrives within a minute. Its last paragraph is: "This is general information, not medical advice. Please check with a healthcare professional."
SN-03 — Care options are always offered
- Look at the buttons under the SN-02 answer.
Expect At most three buttons, and one of them is See Care Options. Each button opens a page; none does nothing.
SN-04 — The conversation is listed and titled
- Look at the conversation list.
Expect The new conversation is at the top, titled from your message.
SN-05 — An emergency answer leads with guidance (fixed in review) (U10 pending)
- Start a new conversation with New.
- Send
I have crushing chest pain.
Expect The answer starts with emergency guidance ("This can be an emergency. Call your local emergency number...") before anything else, and the first button is Talk to a Doctor. Try it a few times: the model's own suggestions vary, and Talk to a Doctor must lead every time.
SN-06 — An over-long note cannot be sent
- Paste more than 2,000 characters into the box.
Expect The character counter turns red and Send is disabled.
FL — When sending fails
The promise is that a patient never loses what they wrote. Use your browser's devtools, Network tab, to go offline.
FL-01 — A failed send keeps the note on screen
- Set the network to Offline.
- Send any note.
Expect Your note stays in the conversation. The card under it says "We couldn't reach the diary. Check your connection and try again." It does not say your note is saved. There is a Try again button, and nothing you typed disappears.
FL-02 — Try again answers the same note once (fixed in review)
- Go back Online.
- Click Try again.
Expect The note is answered. It appears once in the thread, not twice, including after a page reload.
FL-04 — A failed answer can still be asked for after a reload
- Set the network to Offline and send a note.
- Go back Online and reload the page. Open the same conversation.
- Under the note, click Try again.
Expect After the reload the note is still there, with "No answer arrived for this note." and a Try again button. Clicking it answers that note: the words appear once, not as a second note. While it runs the button reads "Asking again..." and cannot be clicked twice.
FL-05 — One retry per note, and no note lost while resuming (fixed in review)
- With a note showing No answer arrived for this note. from FL-04, go Offline and click its Try again.
- Look at the whole conversation.
- Go Online. Send a note that is refused (over 2,000 characters is easiest), then click Try again on the older note.
Expect Step 2: the note appears once, with one Try again button, not two with different wording. Step 3: the refused note stays on screen with its own message while the older note is being asked again -- neither note's words disappear.
FL-03 — A new note after a failure is not swallowed (fixed in review)
- Go offline and send note A.
- Go online. Type a different note B and send it (do not press Try again).
Expect Note B is sent and answered normally. The answer is to B, not to A.
FO — Folders and conversations
FO-01 — Create a folder
- Click New (the + button in the folder row), name it
Knees, click Create.
Expect It appears in the folder strip.
FO-02 — Rename a folder
- Open the menu on
Kneesand rename itKnee pain.
Expect The strip shows the new name.
FO-03 — Move a conversation
- Open a conversation's menu (three dots on its row).
- Under Move to, choose
Knee pain.
Expect The conversation now shows under Knee pain. In the menu, the folder it was already in is listed but greyed out and cannot be chosen.
FO-04 — Removing a folder keeps its contents
- Remove
Knee painfrom its menu and confirm.
Expect The dialog says its conversations move to General Health and nothing is deleted. Afterwards the conversation is under General Health, and its entries still show in History.
FO-05 — Default folders cannot be removed
- Open the menu on Diabetes.
Expect There is no way to remove it.
FO-06 — Rename and delete a conversation
- Rename a conversation from its menu.
- Then delete it.
Expect Rename updates the list. Delete asks for confirmation and says it cannot be undone; afterwards the conversation is gone. Entries it created still show in History; that is expected, and the user guide says so.
FO-07 — A Track button files the conversation
- If an answer offers a Track ... button, click it.
Expect A folder with that name is created and the current conversation moves into it.
HI — History and the visit summary
HI-01 — Each exchange becomes an entry
- Open the History tab.
Expect Each note you sent is listed as a dated entry, with labels where they apply (for example headache).
HI-02 — Clear removes every filter (fixed in review)
- Click two labels to filter.
- Click Clear.
Expect All filters are removed, not only one.
HI-03 — The visit summary (fixed in review)
- Under Before your visit, click Prepare summary.
- Click Print.
Expect A short summary appears, stating the days and entries it covers and when it was prepared. The print dialog opens, and the preview shows only the summary: no sidebar, no diary header, no entry list, no Print button, and a long summary runs onto a second sheet instead of being cut off. Cancel the dialog, then press Ctrl+P on the same page: that prints the page as normal, which is the point of the region being opt-in.
DB — Dashboard card
DB-01 — The card hands the sentence to the diary (fixed in review)
- On the dashboard, type a sentence in the Health Diary card ("How are you feeling today?").
- Press the arrow.
Expect The diary opens with that sentence in the message box. The browser's address bar does not contain the sentence.
DB-02 — The sentence is used once
- Reload the diary page.
Expect The sentence is not put back in the message box.
VO — Voice notes
Needs a secure address: https:// or http://localhost. On any other plain http:// address the browser refuses the microphone. On the website, voice notes are transcribed as English.
VO-01 — Record and play back
- Click the microphone and allow access.
- Speak a sentence, then click the microphone again.
Expect While recording, a red dot and the seconds left out of 120 are shown. Afterwards a player, Send voice note and Discard appear.
VO-02 — Send a voice note
- Click Send voice note.
Expect Your words appear as your message in the thread, followed by an answer with the disclaimer.
VO-03 — Discard releases the microphone
- Record, then click Discard.
Expect The recording is gone and the browser's microphone indicator goes out.
VO-04 — The two-minute cap
- Record without stopping.
Expect Recording stops by itself at 120 seconds.
VO-05 — A voice note starts a conversation (fixed in review)
- Click New, then send a voice note.
Expect The new conversation opens by itself.
VO-06 — Microphone refused
- Block microphone access for the site, then click the microphone.
Expect The page says it could not reach your microphone and that you can type instead. Typing still works.
VO-07 — A failed voice send keeps the recording, and resending does not duplicate (fixed in review)
- Record a note.
- Go offline and click Send voice note.
- Go online and click Send voice note again.
Expect After the failure the recording is still there. After resending, your words appear once in the thread.
CG — Caregivers
Needs an account that manages at least one dependent. Switch with the dependent switcher in the sidebar.
CG-01 — Switching clears an unsent note (fixed in review)
- Type a note but do not send it.
- Switch to a dependent.
Expect A message says the note you were writing was cleared, and the box is empty. An unsent recording is discarded too.
CG-02 — An in-flight note stays in the right diary (fixed in review)
- As yourself, send a note.
- Before the answer arrives, switch to a dependent.
Expect Your note does not appear in the dependent's diary, and the dependent's message box is not locked.
CG-03 — Switching back
- Switch back to yourself.
Expect Your conversation and its answer are in your own diary.
CG-04 — Notes go to the person selected
- While switched to the dependent, send a note.
- Switch back to yourself.
Expect The note is only in the dependent's diary.
AC — Access and limits
Run these with curl or Postman against the API. The commands below get a token for the seeded patient.
AC-01 — Another patient's data is a 404
- As patient A, request a conversation or entry id that belongs to patient B:
GET /patient/health-diary/entries/<B's entry id>.
Expect 404, not 403, and no data.
AC-02 — Text and voice share one hourly allowance
- As one user, send 30 notes in an hour, some typed and some voice.
- Send a 31st.
Expect The 31st returns 429 with error.code rate_limit and a Retry-After header. The web app keeps the note on screen with the card "You've sent a lot of messages", and the card does not say the note is saved.
AC-03 — Malayalam voice is refused before transcription
POST /patient/health-diary/chat/messages/voicewithlanguage=ml, an audio file andduration_ms.
Expect 422 with error.code voice_language_unsupported, and a message that does not blame the recording.
AC-04 — Voice needs a declared length
- Send a voice note without
duration_ms.
Expect 400 duration_required.
AC-05 — A caregiver writes to the dependent's diary, and only theirs
- With a token for an account that manages a dependent,
POST /patient/health-diary/chat/messageswith the headerX-On-Behalf-Of: <dependent's patient id>. GET /patient/health-diary/chat/threadswith and without the header.- Repeat step 1 with the id of a patient who is not this account's dependent.
Expect Step 1 succeeds, and the new conversation is listed only when the header is sent. Step 3 returns 403 forbidden and writes nothing.
DV — Developer-only surfaces
DV-01 — Diagnostics in a development build
- Run the app with
pnpm devand open the diary. - Click Diagnostics (bottom right), then Copy bug report, and paste it somewhere.
Expect The drawer lists the diary's requests. The pasted report contains no message text, no labels and no Bearer token.
DV-02 — No diagnostics in production
- Build with
pnpm buildand open the built app.
Expect There is no Diagnostics button.
Known limits, not bugs
Do not file these
Voice on the website is English only. The web app has no language picker yet. Malayalam voice is refused by the API: our speech-to-text plan does not support it.
Emergency detection uses a starter English word list until clinical review (U10). Treat SN-05 as a check that the guidance is placed correctly, not that every emergency is caught.
A case marked (fixed in review) failed during code review and was fixed. Those are the most likely places for a regression. A case marked (U10 pending) covers behaviour that will change when the clinical safety work lands.
How to report
Comment on #2291 with the case id (for example FL-02), what you saw, and a screenshot. In a development build, open Diagnostics and paste its Copy bug report output. It has the request ids engineering needs, and no health text. Leave the issue open; QA closes it.