We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

Sync error on read-only calendar [answered]

Tracked by Jolla (In release)

asked 2020-03-09 15:39:56 +0200

jollajo gravatar image

updated 2020-03-09 15:58:47 +0200

My calendar stopped syncing, so I checked the logs according https://sailfishos.org/wiki/CalDAV_and_CardDAV_Community_Contributions#Sync_Logs and identified an event on a read-only (caldav) calendar. As I couldn't change anything at the remote side I tried to delete the event in my Sailfish calendar.

The event is gone in my phone's calendar however I still get a sync error.

My first question would be: Isn't there a write protection for read-only calendars? Can I set a read-only mode manually?

My second question: Can I enforce a full sync without deleting and recreation of the account? 3.rd question: is there a way to tell msyncd to continue syncing after the 404 response for just one event?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by jollajo
close date 2020-03-09 16:48:40.688541

1 Answer

Sort by » oldest newest most voted
3

answered 2020-03-09 16:26:33 +0200

It should, yes, yes, no sorry :/

In details:

  • there is a protection for read-only calendars (see the birthday one for instance), on device. But there is no glue at the moment to detect that the remote calcendar is read-only and set the flag locally on device…
  • yes, you can set this flag by hand. You need to play with SQlite, so install it first with devel-su pkcon refresh && devel-su pkcon install sqlite. Then, edit the database (after taking a copy of it, in case), with devel-su -p sqlite3 ~/.local/share/system/privileged/Calendar/mkcal/db. You need to figure out which calendar you want to modify, so list them with select * from calendars;. The read-only bit for flags is 6, see mkcal/src/notebooks.cpp#50 in git.sailfishos.org/mer-core. So you have to add this bit to the flag of your calendar with something like update calendars set flags = NNN where calendarid == "XXX-YYY-ZZZ";, where NNN should be replaced by the sum of the current flag and 64 (1 << 6).
  • yes, you simply need to wipe out the last sync date from the database for the offending notebook. so another update calendars set syncDate = 0 where calendarid == "XXX-YYY-ZZZ";. It will start a full sync from remote at next sync.
  • But I'm not aware of telling msync to ignore a 404 on a given event. This is a server fall in my opinion: the event appears in the etag list sent by the server, so the plugin would like to GET it (event does not exist yet on device or has been modified remotely), or PUT it (event has been modified on device only), but cannot. It's a valid error in my opinion. Is it another case, maybe a bug in the CalDAV plugin then ? Can you detail the case ?
edit flag offensive delete publish link more

Comments

Thanks for your help.

Since I set the read-only flag via sqlite that calendar is no longer visible in the 'Select calendar' dialogue.

Setting syncDate to 0 seems to fix the abortion due to 404 error. The event I deleted locally is still not visible. As it is in the past (11 days ago) it may not be synced anymore, which is alright for me.

Next time I get a sync error I'll record the log message and forward it to you. For now I'm sorted.

Would be great to get a notification of those abortions.

jollajo ( 2020-03-09 16:44:39 +0200 )edit
1

Since I set the read-only flag via sqlite that calendar is no longer visible in the 'Select calendar' dialogue.

What do you mean, the "select calendar" dialog ? Which dialog is it, in which app ?

The event I deleted locally is still not visible.

Strange, it should be… The time range has no impact here, I think the default is 6 months before current date… I'll try to reproduce, but I cannot guess why it's like that :/

Next time I get a sync error I'll record the log message and forward it to you.

That would be great, indeed. Thanks in advance.

Would be great to get a notification of those abortions.

I'm working on it. So we can have access to the simplified logs from UI.

Damien Caliste ( 2020-03-09 17:02:56 +0200 )edit

Since I set the read-only flag via sqlite that calendar is no longer visible in the 'Select calendar' dialogue.

What do you mean, the "select calendar" dialog ? Which dialog is it, in which app ? If you create a new event, you have the option Calendar (to select to which calendar this event is written to), this, by default, shows the calendar you used in your previous edit. If you tap on this entry you get a dialogue / page that lists all your (writable) calendars. In English it's called 'Select calendar'

The event I deleted locally is still not visible.

Strange, it should be… The time range has no impact here, I think the default is 6 months before current date… I'll try to reproduce, but I cannot guess why it's like that :/

I asked my wife to remove that entry, maybe she did it before she sent me the notification. Unfortunately I cannot reproduce it, since the original event has gone on the remote instance.

Would be great to get a notification of those abortions.

I'm working on it. So we can have access to the simplified logs from UI.

Though I follow your contributions, I missed that. It will be a huge improvement. Cheers mate!

jollajo ( 2020-03-09 18:12:14 +0200 )edit

If you tap on this entry you get a dialogue / page that lists all your (writable) calendars

Indeed, this selector is only displaying writable calendars, so I guess, the notebook being now read-only, it's better like that, no ?

maybe she did it before

Let's assume it's the best reason for this ;)

Damien Caliste ( 2020-03-10 10:16:42 +0200 )edit

Question tools

Follow
2 followers

Stats

Asked: 2020-03-09 15:39:56 +0200

Seen: 260 times

Last updated: Mar 09 '20