Deliver Telegram notifications with bounded retries and current permissions #29

Open
opened 2026-11-01 20:11:46 +00:00 by viacheslavshuka · 0 comments

Outcome

Users should receive useful Telegram notifications without stale actions or unbounded retries. Implement aiogram delivery as an adapter around durable notification work.

Acceptance criteria

  • Each attempt rechecks messaging permission, recipient eligibility, current event usefulness, and preferences. Off suppresses sends. Silent uses Telegram's silent-delivery option.
  • Ignoring an organizer does not suppress important updates about existing commitments. Those updates bypass availability hours while retaining channel and permission checks.
  • Allow at most six attempts, including the first. Retry delays after the preceding failure are 30 seconds, 2 minutes, 10 minutes, 1 hour, and 6 hours.
  • A longer Telegram retry_after takes precedence. A delivery deadline can end retries before that delay expires.
  • Stop on confirmed success or permanent failure. Inaccessible recipients pause future delivery until access returns without changing their chosen preference.
  • Invalid credentials and malformed requests do not receive endless retries. Keep an actionable diagnostic without sensitive payloads.
  • Ordinary commitment updates and organizer invitations expire for Telegram delivery 24 hours after their event. Actionable notifications stop earlier when the action is unavailable.
  • Seat offers stop at their existing offer deadline. Reminder attempts stop after their separate two-minute allowance. Discovery uses its availability and digest policy.
  • Store confirmed success separately from an uncertain outcome. An uncertain send may have arrived. Bounded retries may cause occasional duplicate Telegram messages.
  • Inbox records and action validity remain independent of Telegram delivery. Never extend a reservation or invitation because sending failed.
  • Restoring bot access resumes future notifications without replaying the backlog. Provide a link to current website notifications and retain the user's normal, silent, or off preference.
  • Render dynamic text safely in trusted message templates. New personalized timestamps use the recipient's current saved timezone and instant-specific offsets.

Validation design

Use a controlled Telegram adapter for success, retry_after, forbidden recipient, malformed request, credential failure, and ambiguous timeout. Advance a clock through each retry boundary. Change preferences and expire an action between attempts. Crash after an uncertain external send and assert that the inbox still contains one record without claiming exactly-once delivery.

Ignore an organizer between attempts for an existing commitment update. Verify that delivery still follows the channel preference and bypasses availability hours.

Dependencies

## Outcome Users should receive useful Telegram notifications without stale actions or unbounded retries. Implement aiogram delivery as an adapter around durable notification work. ## Acceptance criteria - Each attempt rechecks messaging permission, recipient eligibility, current event usefulness, and preferences. Off suppresses sends. Silent uses Telegram's silent-delivery option. - Ignoring an organizer does not suppress important updates about existing commitments. Those updates bypass availability hours while retaining channel and permission checks. - Allow at most six attempts, including the first. Retry delays after the preceding failure are 30 seconds, 2 minutes, 10 minutes, 1 hour, and 6 hours. - A longer Telegram `retry_after` takes precedence. A delivery deadline can end retries before that delay expires. - Stop on confirmed success or permanent failure. Inaccessible recipients pause future delivery until access returns without changing their chosen preference. - Invalid credentials and malformed requests do not receive endless retries. Keep an actionable diagnostic without sensitive payloads. - Ordinary commitment updates and organizer invitations expire for Telegram delivery 24 hours after their event. Actionable notifications stop earlier when the action is unavailable. - Seat offers stop at their existing offer deadline. Reminder attempts stop after their separate two-minute allowance. Discovery uses its availability and digest policy. - Store confirmed success separately from an uncertain outcome. An uncertain send may have arrived. Bounded retries may cause occasional duplicate Telegram messages. - Inbox records and action validity remain independent of Telegram delivery. Never extend a reservation or invitation because sending failed. - Restoring bot access resumes future notifications without replaying the backlog. Provide a link to current website notifications and retain the user's normal, silent, or off preference. - Render dynamic text safely in trusted message templates. New personalized timestamps use the recipient's current saved timezone and instant-specific offsets. ## Validation design Use a controlled Telegram adapter for success, `retry_after`, forbidden recipient, malformed request, credential failure, and ambiguous timeout. Advance a clock through each retry boundary. Change preferences and expire an action between attempts. Crash after an uncertain external send and assert that the inbox still contains one record without claiming exactly-once delivery. Ignore an organizer between attempts for an existing commitment update. Verify that delivery still follows the channel preference and bypasses availability hours. ## Dependencies - [#22: Keep a durable notification inbox with current action status](https://code.viacheslavshuka.com/viacheslavshuka/quorum/issues/22). Supplies durable event and recipient identities. - [#23: Let users control Telegram delivery, reminders, and digests](https://code.viacheslavshuka.com/viacheslavshuka/quorum/issues/23). Supplies channel and category preferences. - [#20: Display dates and deadlines in each user's saved timezone](https://code.viacheslavshuka.com/viacheslavshuka/quorum/issues/20). Supplies current saved-timezone rendering. - [#16: Run durable PostgreSQL jobs with atomic effects](https://code.viacheslavshuka.com/viacheslavshuka/quorum/issues/16). Supplies restart-safe delivery scheduling. ## Related work - [#63: Send timely session reminders and organizer readiness alerts](https://code.viacheslavshuka.com/viacheslavshuka/quorum/issues/63) - [#55: Announce matching tests once and combine deferred discoveries into digests](https://code.viacheslavshuka.com/viacheslavshuka/quorum/issues/55) - [#45: Browse tests and open website forms through the Telegram bot](https://code.viacheslavshuka.com/viacheslavshuka/quorum/issues/45)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
viacheslavshuka/quorum#29
No description provided.