fix: ensure targets are propagated to inbox (#16985)

Currently the `targets` column in `inbox_notifications` doesn't get
filled. This PR fixes that. Rather than give targets special treatment,
we should put it in the payload like everything else. This correctly
propagates notification targets to the inbox table without much code
change.
This commit is contained in:
Danielle Maywood
2025-03-19 09:51:49 +00:00
committed by GitHub
parent 995e9402b4
commit ef62e626c8
27 changed files with 38 additions and 36 deletions

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Template Deleted",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Template Deprecated",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Test Notification",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "User account activated",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "User account created",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "User account deleted",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "User account suspended",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "One-Time Passcode",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Updated Automatically",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Autobuild Failed",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",
@ -20,7 +20,10 @@
"reason": "autostart"
},
"data": null,
"targets": null
"targets": [
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000"
]
},
"title": "Workspace \"bobby-workspace\" autobuild failed",
"title_markdown": "Workspace \"bobby-workspace\" autobuild failed",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Report: Workspace Builds Failed For Template",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Created",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Deleted",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",
@ -25,7 +25,10 @@
"reason": "autodeleted due to dormancy"
},
"data": null,
"targets": null
"targets": [
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000"
]
},
"title": "Workspace \"bobby-workspace\" deleted",
"title_markdown": "Workspace \"bobby-workspace\" deleted",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Deleted",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Marked as Dormant",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Manual Build Failed",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Manually Updated",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Marked for Deletion",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Out Of Disk",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Out Of Disk",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Workspace Out Of Memory",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Your account has been activated",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",

View File

@ -2,7 +2,7 @@
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.1",
"_version": "1.2",
"notification_name": "Your account has been suspended",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",