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

[buteo-sync-plugin-caldav] Correct URL in case of mangled UIDs. #23

Merged
merged 1 commit into from May 30, 2023

Conversation

dcaliste
Copy link
Contributor

When receiving a new incidence from upstream,
the UID is mangled with the notebook UID to avoid
collision with an existing UID in another notebook.

The URL of the received incidence is stored with
the incidence, so when modifying such incidence
the update is sent to the correct URL and not
one created from the mangled UID.

Unfortunately, creating an exception for such a
recurring incidence on device, will not copy
the URL (as it is stored in comments) and when
pushing the exception to the server, the mangled
UID is used to forge the URL, which is faulty.

See calendarworker.cpp in nemo-qml-plugin-calendar, the dissociateSingleOccurrence() call is properly
copying the comments, but the information is not
passed to the manager via CalendarData::Event
structure. Then, when saving the event in saveEvent(), the proper URL is lost.

@pvuorela, it's a bit strange that I didn't notice it before. The case of having a recurring event coming for upstream and then adding an exception on device was something I only did yesterday, apparently. I was truly convinced that comments were copied in the QML bindings and I needed to reread the code there several times to see that it cannot because the Event struct does not possess such a field. The fix should be in Buteo CalDAV plugin though, because there is no way for the QML bindings to know that comments are holding important code for the sync process.

When receiving a new incidence from upstream,
the UID is mangled with the notebook UID to avoid
colision with an existing UID in another notebook.

The URL of the received incidence is stored with
the incidence, so when modifying such incidence
the update is sent to the correct URL and not
one created from the mangled UID.

Unfortunately, creating an exception for such a
recurring incidence on device, will not copy
the URL (as it is stored in comments) and when
pushing the exception to the server, the mangled
UID is used to forge the URL, which is faulty.

See calendarworker.cpp in nemo-qml-plugin-calendar,
the dissociateSingleOccurrence() call is properly
copying the comments, but the information is not
passed to the manager via CalendarData::Event
structure. Then, when saving the event in saveEvent(),
the proper URL is lost.
Copy link
Contributor

@pvuorela pvuorela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems sane.

@pvuorela pvuorela merged commit 735a9ac into sailfishos:master May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants