68930dcd87
Deploy app frontend / app frontend (push) Failing after 52s
Deploy db-migrations / db-migrations (push) Failing after 39s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Failing after 43s
Deploy service tg-bot / service tg-bot (push) Failing after 2m34s
Web Push Notification Service
This service delivers web push notifications for chat messages and QR code events in HereConnect. It listens for changes in CouchDB and sends push notifications to users.
Features
- Monitors CouchDB for new messages.
- Sends push notifications to owners and guests.
- Configurable notification settings.
- Health server for monitoring.
Prerequisites
- Node.js >= 14.x
- CouchDB server
- VAPID credentials
Installation
npm install
Running the Service
npm start
Usage
The service listens for changes in messages and sends notifications when a new message is created if the recipient has enabled push notifications.
Notifications are sent for:
- Messages from Guests: Sends to owners.
- Messages from Owners: Sends to guests if enabled.
Key Components
- CouchDBChangesStream: Listens to CouchDB changes.
- ServiceSeqTracker: Tracks sequence numbers to prevent missed messages.
- Web Push Notifications: Uses web-push library.
- Health Server: Monitors service status.
Notifications
New messages: Sends a push notification with title, body, and link to the chat.
Error Handling
Logs errors when sending notifications. Tracks sequence to avoid missed messages.
Graceful Shutdown
Handles SIGINT to stop CouchDB changes stream and clean up.
Health Monitoring
Includes a health server for checking service status.