Ethsim2
(Ethan )
September 6, 2026, 3:52pm
631
It may also be worth checking whether this PR has any effect on the Sort topics by event start date option in the per-category settings:
main ← Ethsim12:fix-event-topic-event_time-live-refresh
opened 12:59PM - 04 Sep 26 UTC
## What changed
Event date badges in topic lists could become stale in two wa… ys:
- relative labels such as `in a minute`, `Ends in a minute`, or `a minute ago` did not rerender as time passed unless something else caused the component to update;
- when a recurring event advanced to its next occurrence, `/latest` did not publish an update for the topic, and the existing Topic model did not track the event date fields needed to rerender after rehydration.
This change:
- makes `EventDate` consume Discourse's existing once-per-minute `a11y.autoUpdatingRelativeDateRef`, so future/current/past relative labels update as time passes without adding another timer;
- registers the event date/topic fields as tracked Topic properties so rehydrating an existing topic updates the badge;
- publishes a latest-topic update after a recurring event advances to its next date, while leaving non-recurring event completion unchanged.
## Tests
Automated:
- `bin/qunit --standalone plugins/discourse-events/test/javascripts/integration/components/event-date-test.gjs` — 274 tests, 273 passed, 1 skipped, 0 failed
- `bin/rspec plugins/discourse-events/spec/jobs/scheduled/monitor_event_dates_spec.rb` — 9 examples, 0 failures
- Prettier, ESLint, RuboCop, Syntax Tree and `git diff --check` pass
Manual GUI smoke tests:
- a non-recurring event updated automatically from pre-event relative time to the active `Ends in …` state, then to past relative time, and continued updating each minute without a page refresh;
- a recurring event advanced through the same future/current/past states, then showed Discourse's normal `See 1 new or updated topic` notice after rollover; loading that update changed the badge to the next weekly occurrence (`in 7 days`) without a full page refresh.
The PR wasn’t written specifically for category sorting, but it does change how updated event dates are propagated to existing topic models, and publishes a latest-topic update when a recurring event advances to its next occurrence.
If anyone using Sort topics by event start date has seen topics fail to update/re-sort correctly as event dates change, it would be useful to know whether that still reproduces against the PR head.
1 Like