Timezone for notification of overdue tickets is incorrect
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
The notification of overdue tickets is incorrect. If I see this correctly, the UTC time is saved in the database, which also works fine for me. But I also checked the notification code and found the selector of overdue tickets in following line:
https://github.com/nextcloud/deck/blob/main/lib/Db/CardMapper.php#L286
It seam to use the SQL function now() which leads to an timestamp in the timezone of the database. Our database use the CET timezone so every overdue card become overdue one hour before configured overdue date.
To Reproduce
Steps to reproduce the behavior:
- Set the database timezone to CET timezone
- Create a card with overdue date
- Wait until 1 hour before overdue date
- In nextcloud notification icon in the to you can see notification for the not overdue card
Expected behavior
The overdue selector should use the configured timezone from the user settings.
Client details:
- OS: Windows 10/RedHat Enterprise Linux 8
- Browser: Firefox
- Version: 128.7-esr
Operating system:
RedHat Enterprise Linux 9
Web server:
Apache
Database:
Mariadb 10.5.22
PHP version:
PHP 8.2
Nextcloud version: (see Nextcloud admin page)
29.0.12/30.0.6
Where did you install Nextcloud from:
Tarball
Signing status:
No errors have been found.
List of activated apps:
Enabled:
- activity: 3.0.0
- app_api: 4.0.6
- bruteforcesettings: 3.0.0
- calendar: 5.1.2
- circles: 30.0.0
- cloud_federation_api: 1.13.0
- comments: 1.20.1
- contacts: 7.0.1
- contactsinteraction: 1.11.0
- dashboard: 7.10.0
- dav: 1.31.1
- deck: 1.14.4
- federatedfilesharing: 1.20.0
- federation: 1.20.0
- files: 2.2.0
- files_downloadlimit: 3.0.0
- files_pdfviewer: 3.0.0
- files_reminders: 1.3.0
- files_sharing: 1.22.0
- files_trashbin: 1.20.1
- files_versions: 1.23.0
- firstrunwizard: 3.0.0
- gpxpod: 7.0.4
- guests: 4.2.0
- impersonate: 1.17.1
- logreader: 3.0.0
- lookup_server_connector: 1.18.0
- mail: 4.2.2
- nextcloud_announcements: 2.0.0
- notes: 4.11.0
- notifications: 3.0.0
- oauth2: 1.18.1
- password_policy: 2.0.0
- photos: 3.0.2
- privacy: 2.0.0
- provisioning_api: 1.20.0
- recommendations: 3.0.0
- related_resources: 1.5.0
- richdocuments: 8.5.4
- serverinfo: 2.0.0
- settings: 1.13.0
- sharebymail: 1.20.0
- survey_client: 2.0.0
- systemtags: 1.20.0
- tasks: 0.16.1
- text: 4.1.0
- theming: 2.6.0
- twofactor_backupcodes: 1.19.0
- updatenotification: 1.20.0
- viewer: 3.0.0
- weather_status: 1.10.0
- webhook_listeners: 1.1.0-dev
- workflowengine: 2.12.0
Disabled:
- admin_audit: 1.20.0
- encryption: 2.18.0
- files_external: 1.22.0 (installed 1.19.0)
- files_rightclick: 0.15.1 (installed 1.6.0)
- occweb: 0.2.0 (installed 0.2.0)
- support: 2.0.0 (installed 1.10.1)
- suspicious_login: 8.0.0
- twofactor_nextcloud_notification: 4.0.0
- twofactor_totp: 12.0.0-dev
- user_ldap: 1.21.0
- user_oidc: 5.0.2 (installed 5.0.2)
- user_status: 1.10.0 (installed 1.9.0)
Nextcloud configuration:
no timezone change or something link that.
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 at lib/Db/CardMapper.php#L286 and inspect how the overdue-card selector compares stored timestamps with SQL now(). Reproduce the issue using MariaDB configured for CET and an overdue date, then verify notifications are not emitted before the configured deadline. Done means the selector respects the configured user timezone rather than the database timezone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100