0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 23:04:22 +08:00
discourse/app/services/upcoming_changes/action
Martin Brennan 89c3787d74
FIX: Upcoming change notification data JSON limit (#40626)
When notifying admins of upcoming changes that are
available or promoted, we are storing the names of
the upcoming changes in notification data JSON when
merging with existing unread notifications.

However, notifications have a 1000 char limit for
data, so we were ending up in a situation where we
got an AR error when trying to save the notification with the
merged data that exceeded the limit.

This did not roll back other actions in
`UpcomingChanges::NotifyPromotion`, so a staff action log
was still created, but then the same process would keep
happening.

The UI only ever shows 2 upcoming change names max in
the notification, so we can limit the number of names we store in
the notification data, and also add a transaction to the
service to ensure safe rollback.

Fixes this issue:

```
Failed to notify about promotion of 'granular_anonymous_and_logged_in_groups_permissions': PG::StringDataRightTruncation: ERROR:  value too long for type character varying(1000)
```
2026-06-08 15:40:49 +10:00
..
notification_data_merger.rb FIX: Upcoming change notification data JSON limit (#40626) 2026-06-08 15:40:49 +10:00
track_added_changes.rb FEATURE: Change upcoming change available notification cadence (#40157) 2026-05-25 09:38:33 +10:00
track_removed_changes.rb
track_status_changes.rb FEATURE: Change upcoming change available notification cadence (#40157) 2026-05-25 09:38:33 +10:00