mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: chat auto-archive owner digest notifications (#24643)
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`. > 🤖
This commit is contained in:
@@ -26,6 +26,15 @@ root regardless of individual pin status. Admins and users who want
|
||||
to retain a conversation long after its last message should pin the
|
||||
root.
|
||||
|
||||
## Notifications
|
||||
|
||||
When your chats are auto-archived, you receive a digest notification
|
||||
listing the titles of the archived conversations and the
|
||||
auto-archive window currently configured.
|
||||
|
||||
If you find the digest noisy, you can disable the "Chats
|
||||
Auto-Archived" notification entirely from your notification preferences.
|
||||
|
||||
## Interaction with retention
|
||||
|
||||
Auto-archive and deletion are two independent controls:
|
||||
@@ -79,6 +88,4 @@ set `auto_archive_days` back to `0`.
|
||||
|
||||
Each auto-archived root chat produces an audit log entry with the
|
||||
background subsystem tag `chat_auto_archive`. Cascaded children are
|
||||
not audited individually. The audit entry records the chat ID, owner
|
||||
ID, and organization ID, and the diff shows `archived` flipping from
|
||||
`false` to `true`.
|
||||
not audited individually.
|
||||
|
||||
Reference in New Issue
Block a user