nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
983 stars 241 forks source link

Appointments not bookable on days that had a full day event previously #4530

Open miaulalala opened 2 years ago

miaulalala commented 2 years ago

Steps to reproduce

This issue pops up in combination with Thunderbird Calendar but I haven't een able to determine the cause yet.

  1. Create a full day event from thunderbird and then delete it
  2. Try to book an appointment for that day
  3. The appointment configuration can't create slots for this time frame any more with an error

Expected behavior

The calendar is empty so a slot should be open.

Actual behaviour

No slots are available

Calendar app version

3.2.2

CalDAV-clients used

Thunderbird, Web

Browser

No response

Client operating system

No response

Server operating system

c.nc

Web server

No response

Database engine version

No response

PHP engine version

No response

Nextcloud version

No response

Updated from an older installed version or fresh install

No response

List of activated apps

No response

Nextcloud configuration

No response

Web server error log

{
  "reqId": "CppDl1UKv4nDBaAiAqeL",
  "level": 2,
  "time": "2022-08-02T11:59:02+00:00",
  "remoteAddr": "2001:4bb8:2c0:614a:7997:8abe:6420:1f00",
  "user": "anna",
  "app": "calendar",
  "method": "POST",
  "url": "/apps/calendar/appointment/31/book",
  "message": "No slot available for start: 1659448800, end: 1659451500, config id: 31",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
  "version": "24.0.3.2",
  "exception": {
    "Exception": "OCA\\Calendar\\Exception\\NoSlotFoundException",
    "Message": "Could not find slot for booking",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/apps/calendar/lib/Controller/BookingController.php",
        "line": 185,
        "function": "book",
        "class": "OCA\\Calendar\\Service\\Appointments\\BookingService",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Calendar\\Db\\AppointmentConfig",
            "id": 31
          },
          1659448800,
          1659451500,
          "Europe/Vienna",
          "Anna Larch",
          "anna.larch@nextcloud.com",
          "Testing"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 225,
        "function": "bookSlot",
        "class": "OCA\\Calendar\\Controller\\BookingController",
        "type": "->",
        "args": [
          31,
          1659448800,
          1659451500,
          "Anna Larch",
          "anna.larch@nextcloud.com",
          "Testing",
          "Europe/Vienna"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 133,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Calendar\\Controller\\BookingController"
          },
          "bookSlot"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/AppFramework/App.php",
        "line": 172,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Calendar\\Controller\\BookingController"
          },
          "bookSlot"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/Route/Router.php",
        "line": 298,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Calendar\\Controller\\BookingController",
          "bookSlot",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          [
            31,
            "calendar.booking.bookSlot"
          ]
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/base.php",
        "line": 1023,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/calendar/appointment/31/book"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/cloud.nextcloud.com/nextcloud/apps/calendar/lib/Service/Appointments/BookingService.php",
    "Line": 128,
    "message": "No slot available for start: 1659448800, end: 1659451500, config id: 31",
    "exception": {},
    "CustomMessage": "No slot available for start: 1659448800, end: 1659451500, config id: 31"
  }
}

Log file

No response

Browser log

No response

Additional info

No response

nursoda commented 11 months ago

I see the same behavior for non-day events. Steps to reproduce:

  1. Have a personal calendar and an appointment calendar. Set a new booking calendar as where new bookings go into, and the personal calendar to be checked against for conflicts.
  2. Choose a DAY that has many slots left. Somebody books any slot (like half an hour) on the public booking page.
  3. The calendar owner accepts that appointment and deletes it after that

Result: On the public booking page, nobody can book any slot on that DAY.

Environment: W11/FX→NC28.0.0.11/Calendar 4.6.0