calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Cannot undo > 'Remove occurrence' in 'Repeat'-dialog

Open gre0j opened this issue 7 years ago • 4 comments

I've set a recurring event every 2 weeks (...14.August...28.August...11.September...) The calendar is on mailbox.org and Maya connects via caldav.

Now I deleted one occurrence with Maya (28.August)... remove occurrence

...after that there is an exception in the repeat-setting-dialog of this event, but i cannot delete this. It always reappears after i reopen Maya.delete exception

jar@HP-13:~$ inxi -S
System:    Host: HP-13 Kernel: 4.15.0-32-generic x86_64 bits: 64 Desktop: Gnome
           Distro: elementary OS 5.0 Juno
jar@HP-13:~$ io.elementary.calendar
[INFO 19:29:45.372872] Application.vala:154: Kalender version: (null)
[INFO 19:29:45.372901] Application.vala:156: Kernel version: 4.15.0-32-generic

(io.elementary.calendar:26515): Gtk-WARNING **: 19:29:45.388: Theme parsing error: sidebar.css:30:21: The :focused pseudo-class is deprecated. Use :focus instead.
Gtk-Message: 19:29:53.242: GtkDialog mapped without a transient parent. This is discouraged.
[WARNING 19:29:58.357884] CalendarModel.vala:162: Kalenderobjekt kann nicht verändert werden: Daten konnten nicht gesendet werden: HTTP-Fehlercode 412 (Precondition Failed)

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

gre0j avatar Aug 18 '18 17:08 gre0j

I've found this issue too, but more generally. It seems like any time I remove an occurrence, it leads to this error. (I use Gmail connected with GNOME Online Accounts.) I had to remove and re-add my account.

The HTTP error at the end is the issue. By the looks of things, it means that there's an inconsistency in the data that the server can't deal with. Here's what Google's API says (which I can't understand, but maybe someone else can):

412: Precondition Failed The etag supplied in the If-match header no longer corresponds to the current etag of the resource.

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "conditionNotMet",
    "message": "Precondition Failed",
    "locationType": "header",
    "location": "If-Match",
    }
  ],
  "code": 412,
  "message": "Precondition Failed"
 }
}

Suggested action: Re-fetch the entity and re-apply the changes. For more details see Get Specific Versions of Resources.

mcclurgm avatar Aug 07 '20 14:08 mcclurgm

@mcclurgm I ran into this during Calendar.Store development. The cause of this is, that the user is trying to update an outdated ECal.Component in the UI.

This can happen, if we create a new event in the UI which then gets saved to the backend - but after saving, its not updated in the UI with the backends response (since the backend actually provides it with a new ETag, which is kind of something like a unique timestamp of last mutation).

The same is true if an event is updated in the UI, sent to the backend, but then the ECal.Component is not updated in the UI with the backends response.

Basically everytime the backend fires the corresponding events (objects_added, objects_modified, objects_removed), we must update the UI to use the components provided there - otherwise the ETag gets outdated.

marbetschar avatar Aug 07 '20 18:08 marbetschar

@mcclurgm to test my theory you can:

  • Add a new recurring event
  • Restart the Calendar app (which forces it to display everything freshly from the backend)
  • Try to delete a recurrence now

If I'm on the right track, it should work as expected in this scenario.

marbetschar avatar Aug 07 '20 18:08 marbetschar

Interesting, that's a good find. I'll have a look.

mcclurgm avatar Aug 07 '20 19:08 mcclurgm