Ethsim2
(Ethan )
06.Сентябрь.2026 15:52:22
631
Также стоит проверить, влияет ли этот PR на опцию Сортировать темы по дате начала события в настройках отдельных категорий:
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.
Этот PR не был написан специально для сортировки по категориям, но он изменяет способ, которым обновлённые даты событий передаются в существующие модели тем, и публикует обновление latest-topic, когда повторяющееся событие переходит к своему следующему вхождению.
Если кто-то, использующий Сортировать темы по дате начала события , замечал, что темы не обновляются или не пересортировываются корректно при изменении дат событий, было бы полезно узнать, воспроизводится ли это на текущей версии PR.
1 лайк