elementary/calendar

Inconsistent handling of duplicate events

Opened this issue · 1 comments

What Happened

It's possible to create exact duplicate events in Calendar, and we don't handle this properly at all. Here's what I mean by duplicate: import from an ICS file (that has a UID field), and then without deleting the original copy import it again. You will now have duplicate events, that have the same time, name, UID, and so on. I believe the culprit for these behaviors is the UID.

First, I'm not sure we should allow someone to import duplicate events. (This needs design. I'm not sure what other calendar apps do, but maybe we could look to them for examples)

Otherwise, here are the behaviors I've encountered so far:

  • Each duplicate appears in the sidebar (so if I import 2 versions, 2 appear in the sidebar), but only one shows up in the grid view. I believe this is caused by #597 applying only to the grid view.
  • When I delete one of the duplicate events, there is some weird stuff happening.
    • The instance in the grid view always disappears, even if I deleted a different instance (I can tell because they're in different calendars). The proper one disappears in the sidebar.
    • The other instances remain in the sidebar.
    • If I page to a different month and back, a different instance will appear in the grid view. The same (properly) non-deleted instances are in the sidebar, and the grid shows one of these.

Expected Behavior

The behavior should be somehow consistent: either we need to distinguish properly between duplicate events in our model, or we shouldn't allow this to happen in the first place.

Steps to Reproduce

  1. Import an event from an ICS file.
  2. Import the same ICS file again, without deleting any events first (You can do a different calendar to make the events more easily distinct).
  3. To show the sidebar and delete behaviors, import it again.
  4. The grid behavior appears immediately.
  5. Delete one of the events to show the deletion behavior. Page back and forth to a different month, then back to the original.

Logs

Platform Information

Compiled from git, on Ubuntu 20.04


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

I would like to help with the design of this as I have some ideas.