Commit 6940f22c authored by chriadam's avatar chriadam

Ignore 403 ContentOperationNotPermitted errors due to shared calendars

Some changes (e.g. changing the organizer of an event in a shared
calendar) are not allowed, even if the user has Owner access to the
shared calendar (since the organizer field is managed specially
by Google in the shared-calendar case, allowing only the organizer
or the creator of the event to write changes there).

If we hit such a failure, ignore it and allow sync to succeed.
parent b8563fb3
......@@ -2122,7 +2122,17 @@ void GoogleCalendarSyncAdaptor::upsyncFinishedHandler()
// error occurred during request.
SOCIALD_LOG_ERROR("error" << httpCode << "occurred while upsyncing calendar data to Google account" << accountId << "; got:");
m_syncSucceeded[accountId] = false;
// If we get a ContentOperationNotPermittedError, then allow the sync cycle to succeed.
// Most likely, it's an attempt to modify a shared event, and Google prevents
// any user other than the original creator of the event from modifying those.
// Such errors should not prevent the rest of the sync cycle from succeeding.
// TODO: is there some way to detect whether I am the organizer/owner of the event?
if (reply->error() == QNetworkReply::ContentOperationNotPermittedError) {
SOCIALD_LOG_TRACE("Ignoring 403 due to shared calendar resource");
} else {
m_syncSucceeded[accountId] = false;
} else if (upsyncType == GoogleCalendarSyncAdaptor::Delete) {
// we expect an empty response body on success for Delete operations
if (!replyData.isEmpty()) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment