-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Context
When a Telegram user deletes their chat with the bot or blocks the bot, the dispatcher continues sending messages to that user. When these messages reach the consumer and it tries to send them via Telegram, it fails with specific errors. Currently, these errors are not properly handled, causing issues in the message processing flow.
Objective
Implement proper error handling in the Telegram consumer to detect when users have blocked the bot or deleted the chat, and automatically mark these users as inactive in the database.
Technical Requirements
-
Error Detection in Consumer:
- Catch and identify specific Telegram errors:
403: Forbidden: bot was blocked by the user403: Forbidden: bot was kicked from the chat400: Bad Request: chat not found400: Bad Request: group is deactivated
- Catch and identify specific Telegram errors:
-
User Deactivation Flow:
- When these errors are detected, make an HTTP call to subscription-server
- Update the user's
activestatus tofalsein the database - Log the deactivation event for monitoring
-
Subscription Server Endpoint:
- Create endpoint to handle user deactivation requests
- Update user's active status in database
- Return confirmation to consumer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels