nextcloud / nextcloud/deck

notification on board deletion

Open
#5,650 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug feature: notification
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:

  1. User B configure notifications with deck

  2. User A creates a board and shares it to B

  3. User A deletes the board

  4. wait until the board is deleted from database (duno what are the triggers) plus the activity_mq (including the delete notification) isn't processed

  5. 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 <>

  1. /lib/public/AppFramework/Db/QBMapper.php line 362
    OCP\AppFramework\Db\QBMapper->findOneQuery()
  2. /apps-meae/deck/lib/Db/BoardMapper.php line 92
    OCP\AppFramework\Db\QBMapper->findEntity()
  3. /apps-meae/deck/lib/Service/PermissionService.php line 198
    OCA\Deck\Db\BoardMapper->find()
  4. /apps-meae/deck/lib/Service/PermissionService.php line 111
    OCA\Deck\Service\PermissionService->getBoard()
  5. /apps-meae/deck/lib/Service/PermissionService.php line 160
    OCA\Deck\Service\PermissionService->getPermissions()
  6. /apps-meae/deck/lib/Activity/ActivityManager.php line 571
    OCA\Deck\Service\PermissionService->checkPermission()
  7. /apps-meae/deck/lib/Activity/DeckProvider.php line 114
    OCA\Deck\Activity\ActivityManager->canSeeBoardActivity()
  8. /apps/activity/lib/MailQueueHandler.php line 468
    OCA\Deck\Activity\DeckProvider->parse()
  9. /apps/activity/lib/MailQueueHandler.php line 368
    OCA\Activity\MailQueueHandler->parseEvent()
  10. /apps/activity/lib/MailQueueHandler.php line 165
    OCA\Activity\MailQueueHandler->sendEmailToUser()
  11. /apps/activity/lib/BackgroundJob/EmailNotification.php line 60
    OCA\Activity\MailQueueHandler->sendEmails()
  12. /lib/private/BackgroundJob/Job.php line 54
    OCA\Activity\BackgroundJob\EmailNotification->run()
  13. /lib/private/BackgroundJob/TimedJob.php line 60
    OC\BackgroundJob\Job->execute()
  14. /cron.php line 152
    OC\BackgroundJob\TimedJob->execute()

at 2024-03-07T10:20:14+00:00

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.