nextcloud / nextcloud/deck

Invalid card due date leads to corrupted deck

Open
#6,376 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug feature: modal
Dominant language
JavaScript
Stars
1.4k
Forks
354
Avg merge
1d 10h
Merged PRs (30d)
43

Description

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
I created a new card in a deck. Added a wrong date accidentally. The date field shows the default date template "TT.mm.jjjj --:--" this can be edited but wouldn't be applied to the card and in the card view it shows "invalid date". Deleting the corrupted card showed no effect and after reloading, and clicking on the deck a server error message is shown on the top right. The deck is now not accessible any more an it shows the creation site for a new list when you try to access the deck.

To Reproduce

Steps to reproduce the behavior:

  1. create new deck
  2. create new list
  3. add card to the list
  4. add date
  5. click date field
  6. keep pressing 2 until "TT.mm.jjjj --:--" shows up
  7. deck is now corrupted

Expected behavior
The Card would accept such dates or would show a invalid date but don't break the deck.

Client details:

  • OS: Windows
  • Browser: Chrome
  • Version: 129.0.6668.59 (Offizieller Build) (64-Bit)
  • Device: Desktop
Logs
Nextcloud log (data/nextcloud.log)
{
  "reqId": "SVj0KqaCRViJK7SXVIbf",
  "level": 3,
  "time": "2024-10-01T09:22:11+00:00",
  "remoteAddr": "[IP_REMOVED]",
  "user": "[USER_REMOVED]",
  "app": "deck",
  "method": "GET",
  "url": "/ocs/v2.php/apps/deck/api/v1.0/overview/upcoming",
  "message": "Exception thrown: Exception",
  "userAgent": "[USER_AGENT_REMOVED]",
  "version": "29.0.7.1",
  "exception": {
    "Exception": "Exception",
    "Message": "Failed to parse time string (12222-11-01 07:00:00) at position 12 (0): Double time specification",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/public/AppFramework/Db/Entity.php",
        "line": 126,
        "function": "__construct",
        "class": "DateTime",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/AppFramework/Db/Entity.php",
        "line": 167,
        "function": "setter",
        "class": "OCP\\AppFramework\\Db\\Entity",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/deck/lib/Db/RelationalEntity.php",
        "line": 147,
        "function": "__call",
        "class": "OCP\\AppFramework\\Db\\Entity",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/AppFramework/Db/Entity.php",
        "line": 75,
        "function": "__call",
        "class": "OCA\\Deck\\Db\\RelationalEntity",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
        "line": 321,
        "function": "fromRow",
        "class": "OCP\\AppFramework\\Db\\Entity",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
        "line": 339,
        "function": "mapRowToEntity",
        "class": "OCP\\AppFramework\\Db\\QBMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/deck/lib/Db/CardMapper.php",
        "line": 271,
        "function": "findEntities",
        "class": "OCP\\AppFramework\\Db\\QBMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/deck/lib/Service/OverviewService.php",
        "line": 81,
        "function": "findAllWithDue",
        "class": "OCA\\Deck\\Db\\CardMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/deck/lib/Controller/OverviewApiController.php",
        "line": 48,
        "function": "findUpcomingCards",
        "class": "OCA\\Deck\\Service\\OverviewService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 232,
        "function": "upcomingCards",
        "class": "OCA\\Deck\\Controller\\OverviewApiController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 138,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 331,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/ocs/v1.php",
        "line": 66,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/ocs/v2.php",
        "line": 23,
        "args": [
          "/var/www/nextcloud/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/public/AppFramework/Db/Entity.php",
    "Line": 126,
    "CustomMessage": "Exception thrown: Exception"
  },
  "id": "66fbc3346392a"
}

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 with apps/deck/lib/Db/RelationalEntity.php and apps/deck/lib/Db/CardMapper.php, following the GET /ocs/v2.php/apps/deck/api/v1.0/overview/upcoming request shown in the trace. Reproduce the invalid date steps and inspect how the due date is mapped into an entity. Done means an invalid card date no longer causes the deck or overview endpoint to fail, with the behavior verified after reloading the deck.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
api, backend
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.