Skip to content

fix(appointments): only reset the six-month reminder flag on status changes - #1141

Open
raulriera wants to merge 1 commit into
masterfrom
fix/six-month-callback-guard
Open

fix(appointments): only reset the six-month reminder flag on status changes#1141
raulriera wants to merge 1 commit into
masterfrom
fix/six-month-callback-guard

Conversation

@raulriera

Copy link
Copy Markdown
Member

Summary

  • reset_six_month_reminder_flag_if_confirmed ran on every create/update commit of a confirmed appointment, so an unrelated edit (e.g. notes) on an old appointment re-armed the patient's six-month reminder cycle without any new visit
  • Now guarded on previously_new_record? || saved_change_to_status? (creation still resets, including with the default status)
  • The blanket rescue StandardError # no-op around the patient update is removed — a failed flag reset now surfaces instead of silently skipping a business action

Test plan

  • Red tests: notes-only edit resets flag; StatementInvalid swallowed
  • Green after fix; existing create/transition/cancelled pins still pass
  • Full suite passes (524 runs, 0 failures)

…hanges

The after_commit callback fired on every save of a confirmed
appointment, so editing notes on an old appointment re-armed the
patient's six-month reminder without any new visit, and its blanket
rescue silently swallowed real failures. Guard on creation or a status
change and let errors surface.
@github-actions github-actions Bot added the fix A bug has been resolved label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug has been resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant