Bug 389336 - current mDirtyFields handling in IncidenceBase implementation causes issues with event revision counts (iCal SEQUENCE property)
Summary: current mDirtyFields handling in IncidenceBase implementation causes issues w...
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-kcalendarcore
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-23 04:34 UTC by Jochen Trumpf
Modified: 2022-12-10 05:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Trumpf 2018-01-23 04:34:55 UTC
To reproduce the issue:

1) Accept an event invitation from kmail that you are not the organizer of (not sure if this is really necessary but it is the case that I fully tracked down).
2) Edit the event in korganizer and be careful to ONLY add an alarm.
3) Get the event organizer to send you an event update, for example, with a changed location.
4) Observe how the location change is shown in "reverse logic".
5) Try to accept the changed invitation and get the "This is not an update" error.

What happens under the hood:

Step 2) above should not lead to an increment of the event revision (iCal SEQUENCE property). At least that is the intent of the allowedModificationsWithoutRevisionUpdate logic in akonadi-calendar/incidencechanger.cpp lines 1022ff.

Two things are going wrong, though, and if you watch the actual akonadi payload (e.g. in akonadiconsole), you will see that the revision gets incremented TWICE!

So by the time the organizer sends an update, the local copy is seemingly newer, leading to the incorrect display in kmail as well as the error in Steps 4) resp. 5) above.

One of the revision count increments is caused by lines 657ff in incidenceeditor/incidencedialog.cpp. This seems to be an unconditional increment in this context and I have no idea why it would be there. It appears to preclude any form of "smart" handling of changes within akonadi.

The other revision count increment is due to a failure of the allowedModificationsWithoutRevisionUpdate logic mentioned above. In that function, the dirtyFields() call on the incidence returns many more fields than just IncidenceBase::FieldLastModified and IncidenceBase::FieldAlarms. On my machine it lists a total of 10 fields, including FieldRevision due to the previous increment in incidencedialog.cpp.

The issue seems to be that some of the modifier methods in IncidenceBase and its children set the respective dirty flag even if the value of the property has not changed. For example, setOrganizer in IncidenceBase does not check the previous value and setSecrecy in Incidence or setTransparency in Event fail similarly. On the other hand, some of the set methods do this correctly, for example setUid in IncidenceBase. On my machine, I have observed incorrect behavior for Description, Recurrence, Attachment, Secrecy, Transparency, Attendees, and Organizer (and possibly for Alarms and Revision as well, but that might be confounded with the other issues described here).

Additionally, toggling the alarm on the event (e.g. via the context menu in korganizer) seems to set IncidenceBase::FieldUnknown in dirtyFields() where it should probably be FieldAlarms. With FieldUnknown, toggling the alarm causes similar issues as described here.  

While you are fixing this, the logic in allowedModificationsWithoutRevisionUpdate should probably be expanded to also allow modifications of Categories (not 100% sure about this but I would think that categories are a local property given that they map to akonadi tags). Many people are colour-coding their agendas using (local) categories and in the current implementation that breaks invitation updates.

I am more than happy to try suggested fixes if needed.
Comment 1 Justin Zobel 2022-11-10 22:32:24 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 2 Jochen Trumpf 2022-11-10 22:44:31 UTC
I no longer use kdepim as there were too many unfixed bugs persisting for years despite detailed bug reports.
Comment 3 Bug Janitor Service 2022-11-25 05:21:33 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2022-12-10 05:18:15 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!