Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

DeckProvider::setSubjects() overwrites IEvent subject with translated sentence → InvalidValueException, Deck bell notifications silently dropped

Đang mở Phù hợp với người mới
#8,591 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend

Hướng nghiên cứu

Đọc lib/Activity/DeckProvider.php và kiểm tra OCA\Deck\Activity\DeckProvider::setSubjects(), đặc biệt là lời gọi setSubject() cuối cùng. Issue cho biết việc bỏ lời gọi này sẽ ngăn lỗi định dạng thông báo, đồng thời giữ nguyên nội dung của luồng Activity và email. Xác nhận thay đổi bằng một bài kiểm tra bao quát thông báo chuông cho một sự kiện Deck có tiêu đề đã dịch dài hơn 64 byte; hoàn tất khi thông báo được hiển thị và IEvent::getSubject() vẫn giữ khóa ngắn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

0. Needs triage bug
How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Describe the bug
OCA\Deck\Activity\DeckProvider::setSubjects() ends with
$event->setParsedSubject(str_replace($placeholders, $replacements, $subject)) ->setRichSubject($subject, $richParameters); $event->setSubject($subject, $parameters);

The last call replaces the short subject key stored in oc_activity (e.g. card_update_description) with the translated human‑readable sentence. When the Activity app renders a bell notification (activity_notification), OCA\Activity\NotificationGenerator::getNotificationForEvent() copies $event->getSubject() into INotification::setSubject(), which rejects any subject longer than 64 bytes (isset($subject[64]) in lib/private/Notification/Notification.php).
Activity logs Failed to format activity notification and throws AlreadyProcessedException, so the Notification manager deletes the notification. Result: users never see those Deck events in the notification bell, and the log receives one error entry per affected event on every poll.
In English this hits every event whose template exceeds 64 characters, e.g. card_update_description (“{user} has updated the description of card {card} in list {stack} on board {board}”, 82 chars). In languages with multi‑byte characters (Russian, Greek, CJK, …) practically all Deck sentences exceed 64 bytes, so Deck bell notifications are effectively broken for those users.
The setSubject() call is unnecessary: parsed and rich subjects are already set, and no other provider in server or activity overwrites the raw subject. The same line is still present in main (lib/Activity/DeckProvider.php). Possibly related: #8116.

To Reproduce

  1. Nextcloud 34.0.5, Deck 1.18.6, Activity and Notifications apps enabled.
  2. User A and user B share a board; B is assigned to a card. In B's Settings → Notifications the Deck row “card description changes” has Notification enabled (default).
  3. User A edits the description of that card.
  4. User B opens the bell (or any client polls GET /ocs/v2.php/apps/notifications/api/v2/notifications).

Result: the notification never appears for B, and nextcloud.log gets the entry below. The event is visible in B's Activity stream and e‑mails (those use parsed/rich subject, not the raw one).

Expected behavior
The notification is rendered and shown; IEvent::getSubject() keeps the short key.

Proposed fix
Remove the line $event->setSubject($subject, $parameters); from DeckProvider::setSubjects(). Verified locally on Deck 1.18.6: after commenting out this single line the exception no longer occurs and Activity stream, e‑mails and bell notifications render identically.

` $event->setParsedSubject(str_replace($placeholders, $replacements, $subject))
->setRichSubject($subject, $richParameters);

  •   $event->setSubject($subject, $parameters);
    
    }`

Screenshots
If applicable, add screenshots to help explain your problem.

Client details:
-Nextcloud Server: 34.0.5.1 (custom_apps install path)
-Deck: 1.18.6 (latest available in the App Store at report time)
-Activity: bundled with 34.0.5; Notifications: bundled with 34.0.5
-PHP: 8.3 (php8.3-fpm) · Web server: Apache 2.4 · Database: MariaDB
-Clients: web UI (Chrome 155 on Windows 10)

Server details

Operating system:
Ubuntu 22.04.5 LTS
Web server:
Server version: Apache/2.4.69 (Ubuntu)
Database:
mysql Ver 15.1 Distrib 10.6.23-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
PHP version:
PHP 8.3.36 (cli) (built: Oct 21 2026 14:31:50) (NTS)
Nextcloud version: (see Nextcloud admin page)
version: 34.0.5.1
Where did you install Nextcloud from:
bae metal
Signing status:

Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Logs #### Log entry

{"reqId":"SyslQZoKhzgf7PSFkH7t","level":3,"time":"2026-10-23T14:11:41+03:00","app":"activity","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"Failed to format activity notification","version":"34.0.5.1","exception":{"Exception":"OCP\\Notification\\InvalidValueException","Message":"Value provided for subject is not valid","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/activity/lib/NotificationGenerator.php","line":65,"function":"setSubject","class":"OC\\Notification\\Notification","type":"->"},{"file":"/var/www/html/nextcloud/apps/activity/lib/NotificationGenerator.php","line":139,"function":"getNotificationForEvent","class":"OCA\\Activity\\NotificationGenerator","type":"->"},{"file":"/var/www/html/nextcloud/apps/activity/lib/NotificationGenerator.php","line":131,"function":"getDisplayNotificationForEvent","class":"OCA\\Activity\\NotificationGenerator","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Notification/Manager.php","line":351,"function":"prepare","class":"OCA\\Activity\\NotificationGenerator","type":"->"},{"file":"/var/www/html/nextcloud/apps/notifications/lib/Controller/EndpointController.php","line":105,"function":"prepare","class":"OC\\Notification\\Manager","type":"->"}],"File":"/var/www/html/nextcloud/lib/private/Notification/Notification.php","Line":157}}

Nextcloud log (data/nextcloud.log)
Insert your Nextcloud log here
Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
Ngôn ngữ chính
JavaScript
Star
1.4k
Fork
360
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
114

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/deck

Tất cả issue của nextcloud/deck

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.