mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
70d6efa311
Depends on #24642 Adds per-owner digest notifications onto the chat auto-archive subsystem. Each tick's archived rows are grouped by owner, the top 25 titles per owner are rendered into a new `Chats Auto-Archived` notification template, and any remainder surfaces as `and N more`. Each digest is per-tick, so users with large amounts of purgeable data may get multiple notifications in sequence (one per user per tick). The template body branches on `retention_days`: when retention is disabled (`retention_days=0`), users are told archived chats are kept indefinitely rather than falsely claiming imminent deletion. ### Changes - migration `000XXX_chat_auto_archive_notification_template` adds new notification template - `dbpurge`: threads `notifications.Enqueuer` through `New`; and enqueues notification message. - `cli/server.go`: passes `options.NotificationsEnqueuer` into `dbpurge.New`. - `coderd/notifications/events.go`: new `TemplateChatAutoArchiveDigest` UUID. - `coderd/inboxnotifications.go`: inbox registration. - Docs: adds a `Notifications` section to `chat-auto-archive.md`. > 🤖
39 lines
1.5 KiB
Plaintext
39 lines
1.5 KiB
Plaintext
{
|
|
"_version": "1.1",
|
|
"msg_id": "00000000-0000-0000-0000-000000000000",
|
|
"payload": {
|
|
"_version": "1.2",
|
|
"notification_name": "Chats Auto-Archived",
|
|
"notification_template_id": "00000000-0000-0000-0000-000000000000",
|
|
"user_id": "00000000-0000-0000-0000-000000000000",
|
|
"user_email": "bobby@coder.com",
|
|
"user_name": "Bobby",
|
|
"user_username": "bobby",
|
|
"actions": [
|
|
{
|
|
"label": "View chats",
|
|
"url": "http://test.com/agents?archived=archived"
|
|
}
|
|
],
|
|
"labels": {},
|
|
"data": {
|
|
"archived_chats": [
|
|
{
|
|
"last_activity_humanized": "3 months ago",
|
|
"title": "Onboarding kickoff"
|
|
},
|
|
{
|
|
"last_activity_humanized": "4 months ago",
|
|
"title": "Quarterly planning draft"
|
|
}
|
|
],
|
|
"auto_archive_days": "90",
|
|
"retention_days": "0"
|
|
},
|
|
"targets": null
|
|
},
|
|
"title": "Chats auto-archived after 90 days of inactivity",
|
|
"title_markdown": "Chats auto-archived after 90 days of inactivity",
|
|
"body": "The following chats were automatically archived:\n\n\"Onboarding kickoff\" (last active 3 months ago)\n\"Quarterly planning draft\" (last active 4 months ago)\n\nYou can restore any of them from the Agents page; archived chats are kept indefinitely.",
|
|
"body_markdown": "The following chats were automatically archived:\n\n* \"Onboarding kickoff\" (last active 3 months ago)\n* \"Quarterly planning draft\" (last active 4 months ago)\n\nYou can restore any of them from the Agents page; archived chats are kept indefinitely."
|
|
} |