Skip to content

fix(#9381): accept_case_reports transition fails to persist doc changes#11066

Open
shivv23 wants to merge 1 commit into
medic:masterfrom
shivv23:pr-9381-accept-case-reports
Open

fix(#9381): accept_case_reports transition fails to persist doc changes#11066
shivv23 wants to merge 1 commit into
medic:masterfrom
shivv23:pr-9381-accept-case-reports

Conversation

@shivv23
Copy link
Copy Markdown

@shivv23 shivv23 commented May 14, 2026

Summary

The accept_case_reports transition's onMatch function returns the result of silenceRegistrations(), which resolves to undefined. The transitions framework treats falsy return values as "no changes," so document modifications (messages, place_uuid) are never persisted to the database.

Changes

  • Appended .then(() => true) to the silenceRegistrations call to ensure a truthy return value when the transition completes successfully.
  • Updated the unit test to assert the truthy return value.

Testing

  • All 14 accept_case_reports transition unit tests pass.
  • The fix matches the pattern used by accept_patient_reports and registration transitions, which already return true on success.

…changes

The onMatch function returns silenceRegistrations() which resolves
to undefined. The transitions framework treats falsy return values
as 'no changes', so doc modifications (messages, place_uuid) are
never persisted to the database.

Fixed by appending .then(() => true) to ensure a truthy return
value when the transition completes successfully, matching the
pattern used by accept_patient_reports and registration
transitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant