coder / coder/internal

[discuss] Implement notification: queued for deletion

Open
#10 7 comments 0 reactions 0 assignees View on GitHub
project/notifications question
Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Hi Team,

I wanted to start a discussion about how we can implement this, but didn't want to write a full RFC. Long story short, coderd replica has to send a notification when the workspace is scheduled for deletion (3d, 1d, 30min).

**Proposal**

Let's implement event deduplication similar to Event Sourcing.

1. Every replica periodically checks if the workspace is scheduled for deletion, and its owner should be notified.
2. In the worst case, all replicas take the same decision to insert `notification_message`.
3. Every notifier follows the same process:
3.1 Fetch messages using `AcquireNotificationMessages`.
3.2 For every message: identify its type and call optional logic to verify if delivered.
3.3 If already _delivered_, then _skip delivery_.
3.4 Call optional delivery callback.

_Verification logic_ and _delivery callback_ depend on the notification type. For "queued for deletion" it could check against the database column `notified_deleting_at`. The value is updated by _delivery callback_.

Let me know your thoughts!

cc @dannykopping @mafredri

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.