You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #1083 fixes our side of the "rescheduled … from to" notification, but it cannot finish the job from this repository. The appointment-rescheduled template is managed in the Novu dashboard, not in version control, and it still renders a "from X to Y" sentence unconditionally.
Until someone edits that template, merging #1083 improves one case and leaves another wrong:
Plain release ("Any time works") — there is no new time, because the whole point is that the slots return to the consultant's queue. The payload now says so explicitly, but the template will still try to render a destination and produce a half-empty sentence.
What changed on our side
AppointmentRescheduledPayload gained an outcome discriminator with three arms, expressed as a union rather than optional fields — so MOVED and PROPOSED cannot be constructed without both timestamps, and the blank-blank payload that caused this bug is now a compile error rather than a runtime surprise.
outcome
When
Carries
MOVED
A consultee proposal auto-confirmed into the consultant's published availability
oldDateTimeandnewDateTime
PROPOSED
Times were proposed and are awaiting the other party's answer
oldDateTimeandnewDateTime
RELEASED
A plain release with no destination
oldDateTime only — newDateTime is absent, not undefined
One workflow id with a payload discriminator is this repository's established idiom; reminderStage on ORG_INVOICE_OVERDUE and kind on OrgPayoutFailedPayload both work this way. No second workflow id was minted, deliberately.
What needs doing in the Novu dashboard
Edit the appointment-rescheduled template to branch on the new field, along the lines of:
{% ifpayload.outcome=="RELEASED" %}
{{ payload.consultantName }} released your {{ payload.planTitle }} session
on {{ payload.oldDateTime }}. You will be notified once a new time is set.
{% else %}
{{ payload.consultantName }} moved your {{ payload.planTitle }} session
from {{ payload.oldDateTime }} to {{ payload.newDateTime }}.
{% endif %}
The exact copy is a product decision; the branch is the requirement.
Related, and worth fixing at the same time
The audit that came out of #1083 found this is a pattern rather than a one-off — optional payload fields declared and never passed by any caller. Two remain open:
Any template reading those fields is rendering a blank today.
Verification note
None of this has been seen in a browser. #1083's payload behaviour is unit-tested — including that a plain release carries no newDateTime key at all — but the rendered notification has not been observed.
PR #1083 fixes our side of the "rescheduled … from to" notification, but it cannot finish the job from this repository. The
appointment-rescheduledtemplate is managed in the Novu dashboard, not in version control, and it still renders a "from X to Y" sentence unconditionally.Until someone edits that template, merging #1083 improves one case and leaves another wrong:
What changed on our side
AppointmentRescheduledPayloadgained anoutcomediscriminator with three arms, expressed as a union rather than optional fields — soMOVEDandPROPOSEDcannot be constructed without both timestamps, and the blank-blank payload that caused this bug is now a compile error rather than a runtime surprise.outcomeMOVEDoldDateTimeandnewDateTimePROPOSEDoldDateTimeandnewDateTimeRELEASEDoldDateTimeonly —newDateTimeis absent, not undefinedOne workflow id with a payload discriminator is this repository's established idiom;
reminderStageonORG_INVOICE_OVERDUEandkindonOrgPayoutFailedPayloadboth work this way. No second workflow id was minted, deliberately.What needs doing in the Novu dashboard
Edit the
appointment-rescheduledtemplate to branch on the new field, along the lines of:{% if payload.outcome == "RELEASED" %} {{ payload.consultantName }} released your {{ payload.planTitle }} session on {{ payload.oldDateTime }}. You will be notified once a new time is set. {% else %} {{ payload.consultantName }} moved your {{ payload.planTitle }} session from {{ payload.oldDateTime }} to {{ payload.newDateTime }}. {% endif %}The exact copy is a product decision; the branch is the requirement.
Related, and worth fixing at the same time
The audit that came out of #1083 found this is a pattern rather than a one-off — optional payload fields declared and never passed by any caller. Two remain open:
AppointmentPayload.dateTimeis missing fromnotifyAppointmentBooked(the payments webhook handler) and from bothnotifyAppointmentCompletedcalls in the auto-complete sweep. The reminder path does pass it. Fixing the booked case means adding a slot read to a select that Frontend performance: Prisma over-fetch, zero Next.js caching, raw fetch() everywhere, oversized client bundles #734 deliberately trimmed, inside a payments file another branch is currently editing, which is why fix(appointments): gate Manage Timings on commitment, and give group events a real Unschedule #1083 left it alone.SupportTicketPayload.respondedByhad the same shape and was fixed in fix(appointments): gate Manage Timings on commitment, and give group events a real Unschedule #1083 — a template naming the replying staff member previously had nothing to name.Any template reading those fields is rendering a blank today.
Verification note
None of this has been seen in a browser. #1083's payload behaviour is unit-tested — including that a plain release carries no
newDateTimekey at all — but the rendered notification has not been observed.