server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: Can't see share events if default calendar "Personal" is delete

Open Direaper opened this issue 3 years ago • 5 comments

⚠️ This issue respects the following points: ⚠️

  • [X] This is a bug, not a question or a configuration/webserver/proxy issue.
  • [X] This issue is not already reported on Github (I've searched it).
  • [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • [X] Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • [X] I agree to follow Nextcloud's Code of Conduct.

Bug description

If I delete default calendar "Personal", a can't see share events.

Example: User_1 share event_1 for user_2 If user_2 delete calendar "Personal" he can't see share event_1

I think, share events add by ID calendar "personal", if you delete "Personal", you cant recieve share events anymore.

Steps to reproduce

  1. User_1 Delete default calendar "personal"
  2. User_2 share event_1 to user_1
  3. User_1 cant see share event_1
  4. If User_1 Restore calendar "Personal" from basket, then share events instant add into calendar and user_1 see it.

Expected behavior

  1. Share events must be add into "special calendar". If
  2. I want mark one calendar, by radio button "shareable calendar". If i do it, then all share events adds into this calendar. (Ther is only calendar must be "shareable")

Installation method

None

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • [ ] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

No response

List of activated Apps

dont have it because im just a user

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

Direaper avatar Feb 03 '23 14:02 Direaper

Hi, which nc version?

szaimen avatar Feb 03 '23 15:02 szaimen

24.0.8

Direaper avatar Feb 04 '23 11:02 Direaper

Yes, this is an issue that I've also just encountered with a user of my instance. The scheduler always looks for a calendar whose URL slug is personal, which is useless if that has been deleted. The calendar still exists in the database, but the user is unable to observe the events. In my case, the user's calendar had been migrated from a legacy system, but imported to a new calendar with display name Personal Calendar.

There are two problems here:

  • the events are still persisted to the personal calendar, but they are not visible to the user because the calendar is deleted (however it still exists in the database). As happened in my case, the user now accepts invites but loses them and may miss appointments.
  • the user can very easily get into this situation, especially if they have been migrated and imported old events to a new calendar, but the consequences to the user are not obvious when they delete the calendar, and they have no way to self-resolve the issue.

Tactical fix (for an admin only)

  • undelete the personal calendar (set the deleted_at column to NULL in the calendars table)
  • to ensure the user has only a single calendar to sync:
    • exporting the user's events from Personal Calendar
    • re-importing to the now restored calendar with name Personal.

Longer-term fix

There is a design flaw in the logic that looks up the calendar to use to persist events that are not already associated with a calendar. For example, when another user invites a user, the event must be mapped by the server to the appropriate calendar.

In my case, the likelihood of the personal calendar having been deleted is higher because most users were migrated to Nextcloud from a legacy system and it appears some users have imported their personal calendar to a new calendar object rather than the pre-created personal instance.

One way to resolve would be to introduce a concept of "default calendar" on a per-user level, initialised for new users to personal. Then:

  • when an event is to be persisted to a calendar and is not already associated with a calendar (such as when it's an invite from another user; are there any other examples?), the default calendar is used to identify the calendar for persisting the event
  • when the user attempts to delete the calendar that is currently their default calendar, they are required to nominate a new calendar as the default to ensure events are not lost in future.

mhuxtable avatar Mar 10 '23 18:03 mhuxtable

Hi, please update to 25.0.7 or better 26.0.2 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 26-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

szaimen avatar May 22 '23 10:05 szaimen

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

nextcloud-command avatar Jun 22 '23 00:06 nextcloud-command