Bug 306444 - kcalendar-4.8.5 fails to update a calendar resource (ics) when it is changed
Summary: kcalendar-4.8.5 fails to update a calendar resource (ics) when it is changed
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: ICal file resource (show other bugs)
Version: 4.8
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-08 10:53 UTC by Christian
Modified: 2017-01-07 22:35 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot (70.81 KB, image/png)
2012-09-08 10:54 UTC, Christian
Details
english dialog (38.40 KB, image/png)
2012-09-08 15:06 UTC, Christophe Marin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian 2012-09-08 10:53:47 UTC
I have a calendar file which I use to store most of my appointments. It is configured in the calendar settings as an iCal calendar file with "read-only" flag set. According to the text in the configuration dialog, when "read-only" is set and another program changes the ics file, Kontact will refresh the calendar to take into account the changes.
However, instead I am shown the following error messages in the notification area. (Not sure, are they from Kontact or from something else.) The meaning of the Finnish text is:
(With the KDE icon) The file ".....ics" was changed on the disk. A backup copy of its former contents has been created in "..."
(With the exclamation mark) Calendar - Writing to a read-only resource is being attempted.




Reproducible: Always

Steps to Reproduce:
1. While Kontact is running (or has been opened and was closed)
2. Overwrite the ics file with something else that is an ics file. (E.g. I copy the synchronised ics file to the same file name that is shown in the Kontact.)

Actual Results:  
Error messages on the notification area. The contents of the calendar file shown in Kontact are still the old ones. If I "force" Kontact to re-read the file, e.g. by opening and closing the Kalendar settings dialog, or by logging out and restarting the computer, Kontact takes the updated contents, but it does not take the file automatically.

Expected Results:  
The calendar contents in Kontact should be refreshed immediately when the application notices that the underlying resource has been changed.

I'll attach a screenshot of the notification message.
Comment 1 Christian 2012-09-08 10:54:57 UTC
Created attachment 73740 [details]
Screenshot
Comment 2 Christian 2012-09-08 10:55:19 UTC
By the way, Kontact-4.8.3 had the same behaviour.
Comment 3 Christophe Marin 2012-09-08 15:01:39 UTC
> According to the text in the configuration dialog, when "read-only" is set and another program changes the ics file, Kontact will refresh the calendar to take into account the changes.

Can you double check that ? This text is the one for the third checkbox ("Enable file monitoring")
Comment 4 Christophe Marin 2012-09-08 15:06:40 UTC
Created attachment 73746 [details]
english dialog

Here's a screenshot of the untranslated dialog
Comment 5 Christian 2012-09-09 08:33:41 UTC
(In reply to comment #3)

> Can you double check that ? This text is the one for the third checkbox
> ("Enable file monitoring")

Oh yes, you are right, the text is in the last checkbox called "Observation" ("Tarkkailu"). Maybe it's not clear enough... The text explains about the backup copy, but it does also say that whenever the file is changed its contents will be reloaded. So maybe what I don't get is why the notifications look like error messages. They should just be informations, if they are shown at all. In the case when "file monitoring" is not enabled and the file changes, maybe that should be an error? But in any case, if I tell Korganizer that it should monitor for changes, then it should of course also show me the current file contents in the calendar and not some old backup version. (It always shows the correct contents when I force it to refresh by e.g. logging out and logging in).

Observation
Observe the file (checkbox is checked)
If observation is in use, the data source re-loads the file whenever other applications change its contents. It also attempts to create a backup copy in case of conflicts, if possible.
Comment 6 Christophe Marin 2012-09-09 12:25:05 UTC
Thanks. Changing the product
Comment 7 Christophe Marin 2012-09-09 12:48:47 UTC
> Oh yes, you are right, the text is in the last checkbox called "Observation" ("Tarkkailu").

Which locale do you use ? As you're using a yandex.ru address, I looked at the russian translation but that doesn't seem to match :-)

#. i18n: ectx: property (title), widget (QGroupBox, groupBox_MonitorFile)
#: singlefileresourceconfigdialog_desktop.ui:132
msgid "Monitoring"
msgstr "Мониторинг"

[...]

#. i18n: ectx: property (text), widget (QCheckBox, kcfg_MonitorFile)
#: singlefileresourceconfigdialog_desktop.ui:148
#: singlefileresourceconfigdialog_mobile.ui:65
msgid "Enable file &monitoring"
msgstr "Включить мониторинг файлов"
Comment 8 Christophe Marin 2012-09-09 13:02:17 UTC
forget that, found it :) Adding the finnish translator

Lasse, can you have a look at the comment #5 please ? this string is in akonadi_singlefile_resource.po
Comment 9 Lasse Liehu 2012-09-09 16:00:25 UTC
I don't see anything wrong with the translations of "Monitoring" and "Enable file &monitoring", but suggestions are welcome. There was a mistake with the longer text, and the fixed version is:

#. i18n: ectx: property (text), widget (QLabel, label_5)
#: singlefileresourceconfigdialog_desktop.ui:138
msgid ""
"If file monitoring is enabled the resource will reload the file when changes "
"are made by other programs. It also tries to create a backup in case of "
"conflicts whenever possible."
msgstr ""
"Jos tarkkailu on käytössä, tietolähde lataa tiedoston uudelleen muiden "
"ohjelmien muutettua sitä. Se yrittää myös luoda varmuuskopion ristiriitojen "
"varalta aina kun mahdollista."

(change was: "muiden tiedostojen muutettua" -> "muiden ohjelmien muutettua")
Comment 10 Christian 2012-09-09 16:59:08 UTC
Thanks, guys! I'm on the Finnish locale.
So the text seems to be correct in both Finnish and English, but the behaviour of Kontact is what I am referring to in my bug. When some other application updates the file and I have marked Kontact to "monitor" it, then the changes in the file should appear in Kontact when they happen. (Not just after I restart Kontact.) Or what do you think should happen?
Comment 11 Sergio Martins 2012-11-19 22:47:26 UTC
Can you tell me the exact phrasing of "Calendar - Writing to a read-only resource is being attempted.", in english ? I'd like to see where it's coming from
Comment 12 Christian 2013-05-05 10:23:33 UTC
Sorry for the delay. Here's the exact message in Finnish. ("E...R calendar" is the name of my calendar file.)

"E...R calendar file: Tiedosto ”file:///home/ca/Projects/Technical/E...R calendar.ics” muuttui levyllä. Varotoimenpiteenä varmuuskopio sen aiemmasta sisällöstä luotiin kohteeseen ”file:///home/ca/.kde4/share/apps/akonadi_ical_resource_1/E...R calendar.ics-1”.

Literally, it means "The file... has been changed on the disk. As a backup, a safety copy of its earlier contents has been created to the destination ..."
Comment 13 Christian 2013-05-05 10:25:00 UTC
Also, note that I'm now on 4.10.2 and the behaviour is still the same. Kontact was not even running while this notification was given.
Comment 14 Lasse Liehu 2013-05-05 14:24:31 UTC
Judging from Christian's comment #12, the Finnish message is: Tiedosto ”%1” muuttui levyllä. Varotoimenpiteenä varmuuskopio sen aiemmasta sisällöstä luotiin kohteeseen ”%2”.

And the English one is then:
The file '%1' was changed on disk. As a precaution, a backup of its previous contents has been created at '%2'.

from kdepim-runtime/resources/shared/singlefireresourcebase.cpp (line 230 in master)

"Trying to write to a read-only file: '%1'." comes from kdepim-runtime/resources/shared/singlefileresource.h (line 168 in master).

(By the way, the same message, only without the full stop, is also in kdepim-runtime/resources/contacts/contactsresource.cpp at lines 277 and 327 in master)
Comment 15 Denis Kurz 2016-09-24 20:35:27 UTC
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present?

If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 16 Denis Kurz 2017-01-07 22:35:15 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.