nextcloud / calendar

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

new event does not use Default calendar anymore #5942

Closed tessus closed 5 months ago

tessus commented 5 months ago

Steps to reproduce

  1. open calendar app
  2. create an event

Expected behavior

Default calendar should be picked and selected (the one that was created first as the deafult calendar)

Actual behaviour

The calendar that starts with A is picked.

This behavior seems to be new after the upgrade to 4.7.0. Previously the default calendar was pivked. Now I always have to manually select the default calendar

Calendar app version

4.7.0

CalDAV-clients used

none

Browser

Firefox 125.0.2

Client operating system

macOS

Server operating system

Linux

Web server

Apache

Database engine version

MySQL

PHP engine version

PHP 8.2

Nextcloud version

27.1.8

Updated from an older installed version or fresh install

None

List of activated apps

Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - announcementcenter: 6.8.1
  - appointments: 2.0.7
  - bookmarks: 13.1.3
  - bruteforcesettings: 2.7.0
  - calendar: 4.7.0
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.5.3
  - contactsinteraction: 1.8.0
  - dav: 1.27.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_external: 1.19.0
  - files_pdfviewer: 2.8.0
  - files_reminders: 1.0.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - forms: 3.4.7
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notes: 4.9.4
  - notifications: 2.15.0
  - notify_push: 0.6.10
  - oauth2: 1.15.2
  - password_policy: 1.17.0
  - phonetrack: 0.7.7
  - photos: 2.3.0
  - polls: 5.4.3
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - quota_warning: 1.19.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - side_menu: 3.12.0
  - systemtags: 1.17.0
  - tasks: 0.15.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_totp: 9.0.0
  - twofactor_webauthn: 1.4.0
  - updatenotification: 1.17.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - activitylog: 0.0.2 (installed 0.0.2)
  - apporder: 0.15.0 (installed 0.15.0)
  - dashboard: 7.7.0 (installed 7.0.0)
  - encryption: 2.15.0
  - files_markdown: 2.4.1 (installed 2.4.1)
  - impersonate: 1.14.0 (installed 1.14.0)
  - recommendations: 1.6.0 (installed 0.5.0)
  - support: 1.10.1 (installed 1.4.0)
  - survey_client: 1.15.0 (installed 0.1.5)
  - suspicious_login: 5.0.0
  - user_ldap: 1.17.0
  - user_status: 1.7.0 (installed 1.0.1)

Nextcloud configuration

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.1.8.1",
        "installed": true,
        "forcessl": true,
        "loglevel": 0,
        "maintenance": false,
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "share_folder": "\/Shared",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logdateformat": "Y-m-d H:i:s O",
        "logtimezone": "Europe\/Vienna",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "sendmail",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "appstore.experimental.enabled": true,
        "trashbin_retention_obligation": "auto",
        "updater.release.channel": "stable",
        "integrity.check.disabled": true,
        "htaccess.RewriteBase": "\/",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "auth.bruteforce.protection.enabled": false,
        "simpleSignUpLink.shown": false,
        "upgrade.disable-web": true,
        "theme": "my",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "filesystem_check_changes": 0,
        "mysql.utf8mb4": true,
        "connectivity_check_domains": [
            "google.com"
        ],
        "default_phone_region": "CA",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***"
    }
}

Web server error log

No response

Log file

No response

Browser log

No response

Additional info

No response

st3iny commented 5 months ago

We implemented setting a default calendar recently.

@tessus Please check that the correct default calendar is configured in the calendar settings on the bottom left. Scroll to Default calendar ....

The calendar that is picked by default for new events should match the configured calendar in the settings. If not, there is a bug.

I was not able to reproduce it on 2 separate instances.

tessus commented 5 months ago

@st3iny There is no Default calendar in my calendar settings.

st3iny commented 5 months ago

Ahh right, I just saw that you are on Nextcloud 27.1. I'll give it another test.

bcutter commented 5 months ago

Calendar app v4.7.0 @ Nextcloud Hub 7 (28.0.4). Started seeing error messages when trying to create new events in the web. Log says

InvalidComponentType iCalendar objects must at least have a component of type VTODO

I noticed that a task list is set as calendar. Probably because/since I enabled the "show tasks in calendar" setting (disabled it a minute later). Now the very first task list (named "+++NEW+++") is always preselected when trying to create new events in the (an actual) calendar.

grafik

grafik

I also don't have a default calendar setting (anymore?).

nailyk-fr commented 5 months ago

Exact same issue here. Happened after the latest update to 4.7.1

Even worse, here it defaults creating into a "disabled" calendar.

image

Can I provide any information to help solving the issue ?

No 'default calendar' option anymore on bottom left.

(Nextcloud 27.1.9 & Nextcloud 28.0.5)

st3iny commented 5 months ago

The default calendar option is only shown on Nextcloud 29 and above. It is a fairly recent feature.

Two questions:

  1. Did you share your default calendar with someone or a group etc.?
  2. Is your default calendar an incoming share e.g. shared with you?

On that note: Does any of the two apply to the calendar that is incorrectly selected instead of your default calendar?

bcutter commented 5 months ago
  1. No
  2. No
  3. Additional question: No.

Seems like the app lacks some kind of backward compatibility (<29), isn't it?

tessus commented 5 months ago
  • Did you share your default calendar with someone or a group etc.?
  • Is your default calendar an incoming share e.g. shared with you?

No. No.

Does any of the two apply to the calendar that is incorrectly selected instead of your default calendar?

No.

sena73 commented 5 months ago

I have here 3 nextcloud instances: two 28.0.5 (upgraded from 28.0.3, 28.0.4 recently) and one 28.0.3.

All of them run Tasks 0.15.0 and Calendar 4.7.1

Everything works on 28.0.3 and one of 28.0.5, but not on another 28.0.5! The configuration is pretty the same everywhere. I am getting 'Failed to save event' error and in detailed log 'InvalidComponentType iCalendar objects must at least have a component of type VTODO'

I found that $supportedComponents is set to VTODO in 3rdparty/sabre/dav/lib/CalDAV/Plugin.php

819         if (isset($calendarProperties[$sCCS])) {
 820             $supportedComponents = $calendarProperties[$sCCS]->getValue();
 821         } else {
 822             $supportedComponents = ['VJOURNAL', 'VTODO', 'VEVENT'];
 823         }

So when VEVENT comes from the browser, it throws exception because only VTODO is supported. If I leave line 822 only and force $supportedComponents to ['VJOURNAL', 'VTODO', 'VEVENT'], then everything starts working again and I can add events in web-interface again.

Do I understand correctly from previous comments that somehow default calendar becomes of the type task, that does not allow VEVENT entries? Can you please provide some simple quick workaround? Should I change the default calendar?

May be upgrade to 29? But when I want to upgrade to 29, on the upgrade screen i can see a message "1 app has no compatible version for this Nextcloud version available." "Tasks"

sena73 commented 5 months ago

So, resolved here.

  1. Upgraded to Nextcloud 29, Tasks app is disabled automatically. Hope it will be repaired soon. Problem persists at this point.
  2. Removed "tasks" calendar and added "default" calendar.
  3. Problem resolved.

So that will not work for those who have important items in "tasks" calendar.

tessus commented 5 months ago

@sena73 upgrading is not a proper solution. I have destroyed working nc instances by upgrading too soon in the past. Thus I usually only upgrade when x.y.5 is available. But that's besides the point.

The issue here is that all of a sudden creating an event via the web UI does not pick my default calendar anymore. Otherwise I would have never hit the issue, because it certainly worked in the past. (see the last word anymore in the title). I just do not know when exactly it stopped working.

bcutter commented 5 months ago

I just do not know when exactly it stopped working.

I think it stopped working with 4.7.0 calendar app update.

And yes, updating to NC 29 at this point is definitely not an option. Other things might and will break based on all my major release updates.

Let's fix this issue in this app instead - it started with an update, it can be fixed with an update.

tessus commented 5 months ago

@bcutter I believe you are correct. It've noticed it around the release of 4.7.0

st3iny commented 5 months ago

Thanks for the replies so far. I was able to reproduce it:

  1. Create a list within the Tasks app (will only support VTODO).
  2. Switch to the Calendar app.
  3. Delete the default calendar (should be Personal by default).
  4. Move the task list to the top in the left sidebar.
  5. Reload the page.
  6. Create the new event.
  7. Observe how the task list (or simply: the first calendar in the list) is selected.
  8. Creating an event breaks now because VEVENTs are not supported by the collection.

From my point of view it works as intended as the first calendar is picked from the list in case the "original" default calendar is deleted. Of course, a task list should not be present in the list so that has to be fixed definitely.

For me to investigate

  1. Filter calendars that don't support VEVENTs in the frontend.
  2. Check why it worked before. Could it be that the default calendar url is not respected in that case? AFAIK, we didn't change the logic in the backend if it wasn't configured by the user (which requires >= 29).
st3iny commented 5 months ago

I think I found the bug. The default calendar is now determined by the schedule-default-calendar-URL sent by the backend.

However, the logic that is used in the backend is not identical to the logic we used in the frontend before 4.7.0 to select the default calendar. E.g. the backend skips shared calendars, ignores if a calendar is disabled and doesn't check if it supports VEVENTs.

My proposed solution would be to only use the suggested default calendar from the backend if it makes sense (is enabled etc.) in the frontend and is actually selectable.

nailyk-fr commented 5 months ago

The default calendar option is only shown on Nextcloud 29 and above. It is a fairly recent feature.

Two questions:

1. Did you share your default calendar with someone or a group etc.?

2. Is your default calendar an incoming share e.g. shared with you?

On that note: Does any of the two apply to the calendar that is incorrectly selected instead of your default calendar?

Hello,

Sorry for being late, somehow, I didn't receive notifications. Default calendar is NOT a recent feature. I am using it for very long time.

The one which is now marked as 'do not use' is the original 'personal' one. The 'kittens' which is displayed on top is shared, indeed and not owned by me. Actually, all my calendars belongs to another account. The 'before' behavior, was not really a 'default' calendar, but an order. You can drag and drop the calendars, to change the order in which they are displayed. Then, when creating an event, the one on top was offered by default. It was in the documentation to do this way. (like explained here in 2021 : https://help.nextcloud.com/t/how-to-specify-the-default-calendar/116907 ) I am not able to diff the commits as I don't see the tags/releases, but I believe the order of the offered list changed from 'sorted' to alphabetical.

If you can point me to before 4.7.x I can try to search in the commits.

Best regards

Edit : Might it be this : https://github.com/nextcloud/calendar/commit/aadc104be770f8112edb5d71b46698600f7c612f#diff-0a875d75eb206c0b77505cb23191bdf6921dbe430f5e25f52a241156e3ee3485R9 ? It seems the search was not working before because of the 'typo' filterby vs filter-by ? (careful, I am not good at coding, so I might be completely wrong)

tessus commented 5 months ago

Thanks for the fix, but I doubt that this will solve my issue. In the PR you mentioned Simply use the old logic (first sorted calendar) on older instances.

sorted by what? alphabetically?

I remember that my Default calendar (which was created first when I started to use Nextcloud) to be picked as the default even when I had a calendar with a name that started with a letter A, B, or C.

I guess I will have to wait for nc 29 to define a calendar as the default. Not to be an ass, but this is basic functionality. I still think nextcloud has its priorities twisted. It's 2024 and until now it was just hit and miss for a default calendar or you had to create one thst started with 000_? I am baffled.

I know it is not your fault, but the entire group of nc designers should really work to strengthen (as in make more reliable) and fix the basic functionality instead of creating new (and half baked) features.

st3iny commented 5 months ago

sorted by what? alphabetically?

The way it was before my change was introduced: Sort by the user's custom order (drag and drop in the left calendar list).

I remember that my Default calendar (which was created first when I started to use Nextcloud) to be picked as the default even when I had a calendar with a name that started with a letter A, B, or C.

As long as it is on the top it will be picked by default. Again, just as it was before.

I guess I will have to wait for nc 29 to define a calendar as the default. Not to be an ass, but this is basic functionality.

The actual logic is implemented in the server repository. The calendar app is simply acting as a frontend regarding this feature. Thus, you need to upgrade to 29 in order to define default calendars as a user.

bcutter commented 5 months ago

Thanks. I'm curious to see this in a new release and test it.

As long as it is on the top it will be picked by default. Again, just as it was before.

That's a bit confusing, as I have (for years) a "0_General" at the top of the calendar only (no task lists) list, where I mainly use the "1_Daily" calendar below - which was on the one hand always used as default calendar and on the other hand in fact IS the calendar created as default for that user (just got renamed).

So really curious to see if everything will work again with this fix. NC 29 by the way won't arrive for me within the next 3 to 5 months based on earlier experiences (introduced issues) and the lack of supported apps.

bcutter commented 4 months ago

@st3iny I updated to v4.7.3 and the behaviour is definitely NOT the same "as before". My calendars:

0_General
1_Daily
2_Work
3_Other
4_...

I mainly use 1_Daily (98 %). Before 4.7.0 this was reliably used as default calendar when creating new events. Now always the 0_General is used which is almost as annoying as if a task list would have selected as calendar - because the outcome is the same: I have to manually select the right (default) calendar (1_Daily) every time I create an event.

So thanks for ruling out the tasks lists, but the original core of this issue is definitely NOT solved ⚠️ Simply using the first one in an alphabetical list is not sufficient here.

Please re-open or assist if a new issue is needed.

nailyk-fr commented 4 months ago

Hello all,

No clue if the 2nd commit is also included in the 4.7.4 I just installed, but the behavior is now definitively the same as before for me : Capture d’écran_2024-05-16_13-54-51

(actually, just noticed one calendar is not displayed in the calendar picker :thinking:, but that's another topic and, I don't care, as I am not using that calendar :yum: )

So, in my opinion, this solves the issue perfectly, thanks a lot @st3iny !