0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/db/fixtures
Martin Brennan 4de06a006b
FIX: Do not notify new sites or plugins enabled of old upcoming changes (#42045)
For upcoming changes, we were having a problem where we
were notifying admins of upcoming changes in brand new sites.
A previous fix 2e5afb46e2f5c0547bc298b2bd1a9c39e813dc17 tried
to remedy this, but since it relies on the `new_site?` method, which
isn't true after 1 hour, the next time the scheduled notifications are
run for an admin they will be sent them even if their site is relatively
new.

This commit attempts to conclusively fix the issue by inserting
upcoming change `admins_notified_automatic_promotion` and
`admins_notified_available_change` events via `BackfillNotifiedEvents`
for changes that exist in particular statuses when the site is first
created. These events will have `event_data: {"backfilled" => true}`
to distinguish them from others.

It also fixes an adjacent issue where an admin was notified of a
plugin's upcoming changes as soon as they enable the plugin,
which isn't useful as the intent of upcoming changes is to notify
of changes for things the admin has already been using.

**Before this change, on brand new site with current upcoming change
state**

<img width="401" height="429" alt="image"
src="https://github.com/user-attachments/assets/a89cd641-59aa-4c48-a57c-9692021df176"
/>

**After this change**

No notification to show :) But when I moved an upcoming change to `beta`
it showed
the notification for the enabled upcoming change correctly:

<img width="378" height="174" alt="image"
src="https://github.com/user-attachments/assets/20e4096f-e83f-4c06-970d-a9b43561b12e"
/>
2026-07-30 09:51:08 +10:00
..
001_refresh.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
002_groups.rb FIX: Make auto pseudogroups visible to logged on users (#41498) 2026-07-08 09:28:18 +10:00
003_flags.rb FIX: setup with db:create db:migrate (#29609) 2024-11-06 15:06:17 +11:00
003_post_action_types.rb PERF: do not expire cache when PostActionType is saved (#28337) 2024-08-13 18:01:31 +10:00
004_screened_ip_addresses.rb
005_badge_types.rb
006_badges.rb DEV: raise error on deprecated icon name caught on JS in system and qunit tests (#30942) 2025-01-24 09:26:00 +08:00
007_web_hook_event_types.rb FEAT: add webhooks for calendar events (#38315) 2026-03-09 12:30:19 -05:00
008_directory_columns.rb DEV: Move automatic directory_columns rows from migration to seed fixture (#39970) 2026-05-13 12:12:56 +01:00
009_users.rb
010_uploads.rb
500_categories.rb DEV: Skip Uncategorized insert in add_uncategorized_category on fresh installs (#39971) 2026-05-13 12:13:05 +01:00
600_admin_dashboard_reports.rb DEV: Scaffold backend for the new admin dashboard Reports section (#40017) 2026-05-20 09:53:26 +03:00
600_themes.rb DEV: Support running multisite:migrate concurrently take 2 (#38484) 2026-03-31 10:29:23 +08:00
601_admin_dashboard_sections.rb DEV: Persist dashboard configuration in table and *not* on closure of the dialog (#40546) 2026-06-04 10:53:59 +08:00
700_sidebar.rb DEV: Move Community sidebar section + links from migrations to seed fixture (#39973) 2026-05-13 12:13:12 +01:00
990_settings.rb DEV: Skip backfill INSERTs in old migrations on fresh installs (#39976) 2026-05-13 13:59:28 +01:00
990_topics.rb
991_vapid_keys.rb DEV: Move bootstrap site settings from initializers to seeds (#39942) 2026-05-13 10:07:54 +01:00
992_push_api_secret_key.rb DEV: Move bootstrap site settings from initializers to seeds (#39942) 2026-05-13 10:07:54 +01:00
993_login_hint.rb DEV: Move bootstrap site settings from initializers to seeds (#39942) 2026-05-13 10:07:54 +01:00
995_upcoming_changes.rb FIX: Do not notify new sites or plugins enabled of old upcoming changes (#42045) 2026-07-30 09:51:08 +10:00