Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gre0j opened this issue Aug 18, 2018 · 4 comments
Open

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

gre0j opened this issue Aug 18, 2018 · 4 comments

Comments

@gre0j
Copy link
Contributor

gre0j commented Aug 18, 2018

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.

@mcclurgm
Copy link
Collaborator

mcclurgm commented Aug 7, 2020

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.

@marbetschar
Copy link
Member

@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
Copy link
Member

@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.

@mcclurgm
Copy link
Collaborator

mcclurgm commented Aug 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants