Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card due date notification works only once #2239

Closed
Choukajohn opened this issue Aug 27, 2020 · 2 comments
Closed

Card due date notification works only once #2239

Choukajohn opened this issue Aug 27, 2020 · 2 comments
Assignees

Comments

@Choukajohn
Copy link

Describe the bug
The notification when a card reach the due date is working only once.
After the first notification, if I set a new due date on the same card, notification is not working anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new card
  2. Add a due date and hour
  3. Wait for the notification
  4. Once due date is reached, modify the due hour and save the card.
  5. Notification is not working for the new due date / hour

If a new card is created, notification is working for the new card but only once.

Expected behavior
Notifications should work each time the due date and hour are modified

Server details

Operating system: Ubuntu 19.10 kernel 5.3.0-64

Web server: Apache2

Database: MySQL 8.0.20

PHP version: 7.3.11

Nextcloud version: 19.0.1 with cron service activated

Where did you install Nextcloud from: GitHub

Signing status: No errors have been found.

List of activated apps:

  • accessibility: 1.5.0
    • activity: 2.12.0
    • admin_audit: 1.9.0
    • bruteforcesettings: 1.6.0
    • cloud_federation_api: 1.2.0
    • comments: 1.9.0
    • contactsinteraction: 1.0.0
    • dav: 1.15.0
    • deck: 1.0.5
    • documentserver_community: 0.1.7
    • federatedfilesharing: 1.9.0
    • federation: 1.9.0
    • files: 1.14.0
    • files_external: 1.10.0
    • files_pdfviewer: 1.8.0
    • files_rightclick: 0.16.0
    • files_sharing: 1.11.0
    • files_trashbin: 1.9.0
    • files_versions: 1.12.0
    • files_videoplayer: 1.8.0
    • firstrunwizard: 2.8.0
    • logreader: 2.4.0
    • lookup_server_connector: 1.7.0
    • news: 14.1.11
    • nextcloud_announcements: 1.8.0
    • notes: 3.6.4
    • notifications: 2.7.0
    • oauth2: 1.7.0
    • onlyoffice: 4.3.0
    • password_policy: 1.9.1
    • photos: 1.1.0
    • privacy: 1.3.0
    • provisioning_api: 1.9.0
    • recommendations: 0.7.0
    • serverinfo: 1.9.0
    • settings: 1.1.0
    • sharebymail: 1.9.0
    • support: 1.2.1
    • survey_client: 1.7.0
    • systemtags: 1.9.0
    • tasks: 0.13.3
    • text: 3.0.1
    • theming: 1.10.0
    • twofactor_backupcodes: 1.8.0
    • updatenotification: 1.9.0
    • viewer: 1.3.0
    • workflowengine: 2.1.0
@juliusknorr juliusknorr changed the title [Issue] Cards notifications works only once Card notifications works only once Aug 28, 2020
@juliusknorr juliusknorr changed the title Card notifications works only once Card due date notification works only once Aug 28, 2020
@jakobroehrl
Copy link
Contributor

can reproduce it.

Check the code here:

$entity->setNotified(false);

// check if notification has already been sent
// ideally notifications should not be deleted once seen by the user so we can
// also deliver due date notifications for users who have been added later to a board
// this should maybe be addressed in nextcloud/server
if ($card->getNotified()) {
return;
}
// TODO: Once assigning users is possible, those should be notified instead of all users of the board
$boardId = $this->cardMapper->findBoardId($card->getId());
$board = $this->getBoard($boardId);
/** @var IUser $user */
foreach ($this->permissionService->findUsers($boardId) as $user) {
$notification = $this->notificationManager->createNotification();
$notification
->setApp('deck')
->setUser((string) $user->getUID())
->setObject('card', $card->getId())
->setSubject('card-overdue', [
$card->getTitle(), $board->getTitle()
])
->setDateTime(new DateTime($card->getDuedate()));
$this->notificationManager->notify($notification);
}
$this->cardMapper->markNotified($card);

@juliusknorr
Copy link
Member

Pushed a fix for this to #2430 in 87a7097

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants