notification on board deletion
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 354
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 43
Description
Describe the bug
email notifications on board deletion fail because "BoardMapper->find()" can't find the deleted board.
This exception cancel the mail generation for users, who can't receive emails notifications anymore unless we delete the pending "board_delete" entry in the "activity_mq" table.
To Reproduce
Steps to reproduce the behavior:
-
User B configure notifications with deck
-
User A creates a board and shares it to B
-
User A deletes the board
-
wait until the board is deleted from database (duno what are the triggers) plus the activity_mq (including the delete notification) isn't processed
-
See error
Expected behavior
- the delete notifications should consider deleted boards
or - the function "Db/BoardMapper.php->findToDelete()" should not list boards where references are still in "activity_mq" table.
Logs
Nextcloud log (data/nextcloud.log)
[activity] Erreur: OCP\AppFramework\Db\DoesNotExistException: Did expect one result but found none when executing: query "SELECT * FROM *PREFIX*deck_boards WHERE (id = :dcValue2) AND (deleted_at = :dcValue1) ORDER BY id ASC"; at <>
- /lib/public/AppFramework/Db/QBMapper.php line 362
OCP\AppFramework\Db\QBMapper->findOneQuery() - /apps-meae/deck/lib/Db/BoardMapper.php line 92
OCP\AppFramework\Db\QBMapper->findEntity() - /apps-meae/deck/lib/Service/PermissionService.php line 198
OCA\Deck\Db\BoardMapper->find() - /apps-meae/deck/lib/Service/PermissionService.php line 111
OCA\Deck\Service\PermissionService->getBoard() - /apps-meae/deck/lib/Service/PermissionService.php line 160
OCA\Deck\Service\PermissionService->getPermissions() - /apps-meae/deck/lib/Activity/ActivityManager.php line 571
OCA\Deck\Service\PermissionService->checkPermission() - /apps-meae/deck/lib/Activity/DeckProvider.php line 114
OCA\Deck\Activity\ActivityManager->canSeeBoardActivity() - /apps/activity/lib/MailQueueHandler.php line 468
OCA\Deck\Activity\DeckProvider->parse() - /apps/activity/lib/MailQueueHandler.php line 368
OCA\Activity\MailQueueHandler->parseEvent() - /apps/activity/lib/MailQueueHandler.php line 165
OCA\Activity\MailQueueHandler->sendEmailToUser() - /apps/activity/lib/BackgroundJob/EmailNotification.php line 60
OCA\Activity\MailQueueHandler->sendEmails() - /lib/private/BackgroundJob/Job.php line 54
OCA\Activity\BackgroundJob\EmailNotification->run() - /lib/private/BackgroundJob/TimedJob.php line 60
OC\BackgroundJob\Job->execute() - /cron.php line 152
OC\BackgroundJob\TimedJob->execute()
at 2024-03-07T10:20:14+00:00
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the deletion-notification path through Db/BoardMapper.php, Service/PermissionService.php, Activity/ActivityManager.php, and Activity/DeckProvider.php, using the provided reproduction steps and stack trace. Check how the activity_mq entry is processed after the board is deleted. Done means board deletion notifications can be processed without an exception and the pending queue entry no longer blocks email delivery.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100