Обновлены сигналы для полностью асинхронной обработки:
- requests_app: новые заявки, комментарии, изменения статуса
- documents: новые документы для всех сотрудников
Добавлена задача process_document_notifications_task
Все циклы for recipient in recipients теперь выполняются в фоне:
✅ Сигналы используют transaction.on_commit + .delay()
✅ Signal handlers сразу возвращают управление
✅ API не блокируется при массовых рассылках
Fixes: Блокировка транзакций при создании заявок/документов
- Добавлена конфигурация Celery (eusrr_backend/celery.py)
- Созданы async задачи для уведомлений (notifications/tasks.py)
- Обновлены все notification_signals на create_notification_async()
- Добавлен метод NotificationService.create_notification_async() с fallback
- Установлены пакеты: django-celery-beat, django-celery-results, flower
- Применены миграции для Celery приложений
- Документация: CELERY_SETUP.md, CELERY_INTEGRATION_PLAN.md
Производительность: уменьшение времени отправки сообщений с ~500ms до <50ms
- Split notification sending into separate WebSocket and Web Push channels
- Add Web Push support for offline users
- Configure VAPID keys for push authentication
- Add 'aud' field to VAPID claims for WNS compatibility
- Optimize subscription sync - only POST when endpoint changes
- Remove debug logs and minimize server logging
- Update Service Worker with improved error handling
- Add Service-Worker-Allowed header for proper scope
Web Push now works independently from WebSocket, enabling
notifications when browser is closed (requires HTTPS in production)
- Исправлены некорректные URL в feed/notification_signals.py (/feed/post/{id}/ → /post/{id}/)
- Исправлены URL в documents/notification_signals.py (удален несуществующий /documents/{id}/)
- Добавлены 3 недостающих endpoint для Telegram интеграции в notifications/api_urls.py
- Создан отчет об аудите URL уведомлений (NOTIFICATION_URLS_AUDIT.md)
- Создан полный список всех эндпоинтов проекта (ENDPOINTS_LIST.md)
- Added departments ManyToMany field to Document model
- Implemented department selection in document create/edit modals
- Added automatic notification creation for all department employees
- Fixed document filtering to include uploaded documents in 'My Documents'
- Fixed acknowledgements API to include department recipients
- Added bulk notification support with configurable threshold
- Removed acknowledge button, added visual highlighting for unread documents
- Implemented server-side acknowledgment flow with redirect to file
- Fixed mobile responsive layout for document actions
- Removed temporary test files and documentation
- ApiClient теперь обрабатывает 401 и 403 ошибки для обновления токена
- Добавлен JWTRefreshMiddleware для проактивного обновления токенов за 5 минут до истечения
- Добавлена настройка JWT_REFRESH_THRESHOLD_MINUTES (по умолчанию 5)
- Исправлена проблема с периодическими 403 ошибками после истечения access token