Skip to content

Add task lock expiry reminder emails#1250

Draft
CollinBeczak wants to merge 1 commit into
mainfrom
feature/task-lock-expiry-reminder
Draft

Add task lock expiry reminder emails#1250
CollinBeczak wants to merge 1 commit into
mainfrom
feature/task-lock-expiry-reminder

Conversation

@CollinBeczak

Copy link
Copy Markdown
Contributor

Emails users with an opt-in subscription shortly before one of their locked tasks is about to be auto-unlocked by the cleanLocks job. The reminder window is configurable (default 10 minutes) and the scheduled job is itself opt-in: omit osm.scheduler.notifications.taskLockExpiryReminder.interval to leave it unscheduled.

  • Adds NOTIFICATION_TYPE_TASK_UNLOCK_WARNING (16) and a taskUnlockWarning field on NotificationSubscriptions, defaulting to NOTIFICATION_EMAIL_NONE.
  • Adds the sendTaskLockExpiryReminders SchedulerActor job, which uses an atomic UPDATE...RETURNING on the locked table so overlapping runs cannot double-send.
  • Evolution 119 adds reminder_sent_at to locked and task_unlock_warning to user_notification_subscriptions.

Emails users with an opt-in subscription shortly before one of their
locked tasks is about to be auto-unlocked by the cleanLocks job. The
reminder window is configurable (default 10 minutes) and the scheduled
job is itself opt-in: omit `osm.scheduler.notifications.taskLockExpiryReminder.interval`
to leave it unscheduled.

- Adds NOTIFICATION_TYPE_TASK_UNLOCK_WARNING (16) and a `taskUnlockWarning`
  field on NotificationSubscriptions, defaulting to NOTIFICATION_EMAIL_NONE.
- Adds the `sendTaskLockExpiryReminders` SchedulerActor job, which uses
  an atomic UPDATE...RETURNING on the `locked` table so overlapping runs
  cannot double-send.
- Evolution 119 adds `reminder_sent_at` to `locked` and
  `task_unlock_warning` to `user_notification_subscriptions`.
@sonarqubecloud

Copy link
Copy Markdown

-- the sendTaskLockExpiryReminders job does not email the same user about
-- the same lock more than once.
ALTER TABLE IF EXISTS locked
ADD COLUMN reminder_sent_at timestamp without time zone DEFAULT NULL;;

@ljdelight ljdelight Jul 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you remove the timezone? That will break things, the zone should always be tracked so that timings can be correct based on a user's zone (vs the server's configured timezone, which is not reliable).

edit: i know it's a draft, giving you a heads up on that one. also you'd wanna do a 'add column if not exists'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants