mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 23:04:22 +08:00
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) ``` |
||
|---|---|---|
| .. | ||
| notification_data_merger.rb | ||
| track_added_changes.rb | ||
| track_removed_changes.rb | ||
| track_status_changes.rb | ||