Skip to content

Resend a series or session calendar invite - #454

Merged
jhodapp merged 11 commits into
mainfrom
resend-calendar-invite
Oct 20, 2026
Merged

jhodapp merged 11 commits into
mainfrom
resend-calendar-invite

Conversation

@jhodapp

@jhodapp jhodapp commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

Lets a coach resend the calendar invite for a coaching session series or a one-off session. A coachee who missed or declined part of a series gets an .ics that matches the series as it is now, and their calendar updates the existing event instead of adding a duplicate.

Frontend: refactor-group/refactor-platform-fe#490.

Changes

  • POST /coaching_session_series/:id/resend_invite and POST /coaching_sessions/:id/resend_invite (coach only, no body).
    • They reuse the existing "scheduled" emails and go to both coach and coachee.
    • The send is synchronous: 204 sent; 409 {details.reason} = legacy_series / no_upcoming_sessions / series_member; 502 when the coachee wasn't reached.
  • The series resend attaches a snapshot .ics: the master RRULE, plus an EXDATE per deleted occurrence, plus an override VEVENT per moved one. To support this, ical.rs gained EXDATE and multi-VEVENT build_calendar.
  • A series resend raises every member's ical_sequence to at least the series' value. Google Calendar drops an override whose SEQUENCE is lower than its master's; the live test caught this.
  • send_series_invite_email now reports Delivered, the same way the one-off path already did.
  • GET /users/:id/coaching_sessions?include=series adds series: { id, last_session_date }, so the UI can disable the action on a finished series.

Testing Strategy

  • cargo test --workspace --features mock: 2780 pass. New coverage: snapshot builder, delivery reporting, all 10 endpoint cases through the real routers, and include=series.
  • Live run against Resend and Google Calendar, following refactor-platform-fe/docs/test-plans/resend_calendar_invite_manual_testing.md.
    • A lost series came back with its moved session on the new day and its deleted dates gone.
    • A second resend updated the accepted event in place.
    • The one-off, legacy and refusal paths passed, and deleting the fixtures through the UI sent the expected cancellations.
  • Live testing tip: start the backend with SESSION_REMINDER_EMAIL_TEMPLATE_ID= (blank). Otherwise the reminder sweep emails real participants at boot.

Concerns

Three problems found here that predate this branch:

  • Series dates are worked out in UTC, but the .ics is anchored to the coach's timezone. Around DST, the calendar and the app drift by an hour.
  • After two or more series reschedules, recreated sessions restart at SEQUENCE 0. Later single-occurrence reschedules can then be ignored by Google.
  • The coach's copy of the "series scheduled" email says the coachee scheduled it.

@jhodapp jhodapp self-assigned this Oct 20, 2026
@jhodapp jhodapp added the enhancement Improves existing functionality or feature label Oct 20, 2026
@jhodapp jhodapp added this to the 1.0.0-beta4 milestone Oct 20, 2026
@jhodapp
jhodapp marked this pull request as ready for review October 20, 2026 18:20
@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge; no new actionable issue was found.

Summary

Adds coach-only actions to resend session and series calendar invites. Series resends include deleted dates and changed occurrences while keeping the existing calendar identity.

  • Coaches can resend a series invite with its current dates.
  • Coaches can resend invites for upcoming standalone sessions.
  • Session lists can include the latest date for each series.

Diagram

sequenceDiagram
    participant Coach
    participant API
    participant DB
    participant Email
    Coach->>API: Resend session or series invite
    API->>API: Check login and coach access
    API->>DB: Load current schedule
    API->>DB: Bump sequence and commit
    API->>API: Build calendar snapshot for a series
    API->>Email: Send invites to both participants
    Email-->>API: Report send results
    API-->>Coach: 204 on success, 502 if coachee send fails
Loading

Reviews (2) · Last reviewed commit: "fix: address review on resend invite" · Reviewed by Greptile

Comment thread domain/src/emails.rs Outdated
Comment thread web/src/router.rs
Comment thread web/src/controller/resend_invite_tests.rs Outdated
Comment thread web/src/controller/coaching_session_controller.rs
Comment thread web/src/controller/resend_invite_tests.rs Outdated
Comment thread entity_api/src/coaching_session.rs
@jhodapp
jhodapp merged commit 6d2f48a into main Oct 20, 2026
8 checks passed
@jhodapp
jhodapp deleted the resend-calendar-invite branch October 20, 2026 19:12
@github-project-automation github-project-automation Bot moved this from Review to ✅ Done in Refactor Coaching Platform Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improves existing functionality or feature

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant