0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 06:24:48 +08:00
discourse/plugins/discourse-calendar/spec/services/discourse_post_event
Régis Hanol 5a926782fe
FIX: Single-occurrence RSVPs filled the "My events" calendar (#40813)
Addresses the **My events** calendar issue reported in [meta
t/335780](https://meta.discourse.org/t/repeating-event-going-gets-not-deleted-anymore/335780),
and improves how the event popup loads.

## FIX: Single-occurrence RSVPs filled the "My events" calendar

When a member RSVPs "going" to only the next occurrence of a recurring
event (not the whole series), the personal **My events** calendar — and
the personal ICS feed — listed the event on _every_ occurrence instead
of just the one they joined.

`EventFinder` matches an event for `attending_user` whenever the member
is a "going" invitee, ignoring the invitee's `recurring` flag, and the
events endpoint then expands the full recurrence series. The
per-occurrence invitee list already filtered single RSVPs out of future
occurrences, but the calendar/feed query did not.

`ExpandOccurrences` gains a `current_occurrence_only` option that
returns only the event's current occurrence (when it falls inside the
requested window). `EventsController#index` sets it for the attending
member's non-recurring "going" RSVPs, in both the JSON and ICS
responses. RSVPs to every occurrence still expand fully; the
non-personal calendars (all events / category) are unaffected.

This is a targeted fix — properly modelling per-occurrence RSVPs
(storing each date instead of only the recurrence formula) remains a
larger follow-up.

## UX: Render event popup details immediately instead of a spinner

Clicking an event opened a popup that showed only a loading spinner
until a full event fetch resolved — slow on poor connections. The
component wrapped its whole body in `DAsyncContent`, blocking every
field on the request even though the calendar already provides each
event's core fields (`BasicEventSerializer`) and the inline post widget
provides the complete event (`EventSerializer`).

It now renders the data already on the client immediately (title, date,
recurrence) and fills in the rest (creator, attendees, RSVP buttons)
when the background request returns. Inline event widgets in a topic
render fully with no fetch at all (and no longer fire a redundant
request). Still-loading sections use core's `.placeholder-animation`
shimmer.

## Testing

- Request spec — single-occurrence RSVP returns one occurrence;
all-occurrences RSVP returns the series.
- Service spec — `current_occurrence_only` returns the current
occurrence only when it is inside the window.
- System spec — a daily recurring event RSVPed once shows a single tile
on `/upcoming-events/mine`.
- Existing popup integration + system specs cover the immediate-render
behaviour.
2026-07-01 21:04:25 +02:00
..
action FIX: Single-occurrence RSVPs filled the "My events" calendar (#40813) 2026-07-01 21:04:25 +02:00
event DEV: Extract post event sync into a service object (#41055) 2026-06-24 18:41:32 -03:00
bulk_invite_spec.rb DEV: Extract mutating EventsController actions into services (#41053) 2026-06-24 18:45:06 -03:00
chat_channel_sync_spec.rb
create_invitee_spec.rb
csv_bulk_invite_spec.rb DEV: Extract mutating EventsController actions into services (#41053) 2026-06-24 18:45:06 -03:00
destroy_event_spec.rb DEV: Extract mutating EventsController actions into services (#41053) 2026-06-24 18:45:06 -03:00
destroy_invitee_spec.rb FIX: Reset topic tracking when an attendee leaves an event (#40490) 2026-06-15 09:06:46 -03:00
invite_spec.rb DEV: Extract mutating EventsController actions into services (#41053) 2026-06-24 18:45:06 -03:00
list_invitees_spec.rb FIX: Escape LIKE wildcards in event invitee filtering (#40524) 2026-06-15 09:49:28 +02:00
update_invitee_spec.rb