nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
988 stars 240 forks source link

Calendar ignores ical DESCRIPTION;ALTREP when updating event description #3863

Closed cm-schl closed 2 years ago

cm-schl commented 2 years ago
Discussion started at Bugzilla of the Thunderbird Project: [1748002](https://bugzilla.mozilla.org/show_bug.cgi?id=1748002) Preamble: Thunderbird introduced formatting options for event descriptions that are saved via CalDAV as `DESCRIPTION;ALTREP`. Thunderbird always saves a HTML version (formatted) and a plain text version of the event description like defined in [RFC5545](https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.1). ### Steps to reproduce 1. Use Thunderbird Version 91 to create an event with text in the description field, for example the word "test". The event gets saved correctly on the CalDAV server. The description field of the VEVENT contains: `DESCRIPTION;ALTREP="data:text/html,%3Cbody%3Etest%3C%2Fbody%3E":test` 2. Open Nextcloud Calendar and edit the event description text to "1111111111111111test". Now the VEVENT on the server looks like this: `DESCRIPTION;ALTREP="data:text/html,%3Cbody%3Etest%3C%2Fbody%3E":1111111111111111test` 3. Open the event in Thunderbird. The event description only contains "test" because Thunderbird shows the content of `ALTREP`. ### Expected behaviour After a discussion at bugzilla.mozilla.org ([1748002](https://bugzilla.mozilla.org/show_bug.cgi?id=1748002)) it seems not correct that Nextcloud updates only the plaintext version of the event description without modifying or deleting the alternative representation under `ALTREP`. Other CalDAV clients like mobile phone apps seem to delete everything under `ALTREP` when the plaintext version has been modified by the user. The problem is that actually the user does not see modifications made via Nextcloud (for example in shared calendars) and therefore overwrites these changes if he tries to update the event description using Thunderbird. Naturally the best solution would be if Nextcloud Calendar would show the formatted version instead of the plaintext version 😉, but at the moment it seems important that Thunderbird users aren't going to overwrite changes made using Nextcloud. ### Actual behaviour As you can see Nextcloud only updates the plain text description, but the HTML description in ALTREP isn't updated nor deleted. ### Calendar app **Calendar app version:** 3.0.4 **CalDAV-clients used:** Thunderbird Lightning, DAVx5, Simple Calendar (Android) for tests ### Client configuration **Browser:** Firefox 91.4.1 **Operating system:** Windows 10 **Nextcloud Version:** 21.0.7
tcitworld commented 2 years ago

Thanks for the bug report.

As a sidenote, we will probably use RFC9073's STYLED-DESCRIPTION for rich text formatting if we ever have this feature (see #3234), not ALTREP.

benbucksch commented 2 years ago

The bug comes from the data being inconsistent now. When the description changes, the parameters of the DESCRIPTION property are no longer valid.

The expected minimal behavior is that NextCloud, when writing the DESCRIPTION property, also deletes all parameters of the DESCRIPTION property, which are now outdated.

So, the fix here should be simple: When setting DESCRIPTION, just delete all parameters of DESCRIPTION property, including the ALTREP parameter. That avoids the bug.

benbucksch commented 2 years ago

Given that the property parameters describe the property (not the whole calendar item, just this property), and the property changed, it's reasonable to assume that the parameters which described the old property are no longer valid.

Gorendal commented 2 years ago

The same issue comes with X-ALT-DESC, which is used by other clients like Outlook and eM-Client to add an HTML representation of the description value. Would it be possible to delete the field, too, once the description is changed in Nextlcoud?

max65482 commented 2 years ago

This should be fixed in #3924. All parameters should be deleted upon modification of the description. Can you give exact reproduction steps or excerpts from ics files?

benbucksch commented 2 years ago

@Gorendal Could you file a new ticket about that, and mention the new ticket number here?

While it's the same symptom, the cause is different, because ALTREP is a "parameter" of the modified DESCRIPTION property, whereas X-ALT-DESC is a completely different property. It needs a different fix.

st3iny commented 2 years ago

@Gorendal @benbucksch Please refer to #4744.

Gorendal commented 1 year ago

@st3iny @benbucksch is there still something to be done from my side? Sorry, I am new to GitHub. So I haven't got the complete picture how this all works yet.

benbucksch commented 1 year ago

@Gorendal Possibly in reaction to your comment, @st3iny filed a new ticket #4744, which captures the problem that you raised. (It is a different problem than this ticket here, and this ticker here is already fixed, therefore it needed a new ticket.)

Good news is that #4744 was already fixed by @st3iny, so the problem you mentioned should be fixed now. It was even backported to NextCloud 3.5.x and 4.1.x.

You can test the next NextCloud release, whether it fixes your issue. Otherwise, there's nothing more to do. Any comments should be posted to #4744.

Gorendal commented 1 year ago

@benbucksch Sounds great. I am happy to test it. I just checked my Nextlcloud instance and it anyway offers an update to 25.0.2. So my current Calendar version is 4.1.0.

However: The behaviour still seems to stay the same after changing the description of an appointment in Nextcloud. The connected client "eM-Client" still logs the X-ALT-DESC field in the following VEVENT received from Nextcloud:

SUMMARY:Test Meeting 1 DESCRIPTION:first line added in eM-Client\nsecond line added in eM-Client\n third line added in Nextcloud\nfourth line added in Nextcloud X-ALT-DESC;FMTTYPE=text/html:<html><head><style id="css_styles">blockquote. cite { margin-left: 5px\; margin-right: 0px\; padding-left: 10px\; padding- right:0px\; border-left: 1px solid #cccccc }\nblockquote.cite2 {margin-left : 5px\; margin-right: 0px\; padding-left: 10px\; padding-right:0px\; border -left: 1px solid #cccccc\; margin-top: 3px\; padding-top: 0px\; }\na img { border: 0px\; }\nli[style='text-align: center\;']\, li[style='text-align: c enter\; ']\, li[style='text-align: right\;']\, li[style='text-align: right\ ; '] { list-style-position: inside\;}\nbody { font-family: Segoe UI\; font -size: 12pt\; } \n.quote { margin-left: 1em\; margin-right: 1em\; border- left: 5px #ebebeb solid\; padding-left: 0.3em\; }</style></head><body>first line added in eM-Client<div>second line added in eM-Client</div></body></h tml>

I wonder if I can check somehow the Nextcloud files on my server, if st3iny's fix is already available? I tried to locate the modified file "src/store/calendarObjectInstance.js" on my server but were not successful. Any idea?

benbucksch commented 1 year ago

@Gorendal As mentioned above, please make your comments at #4744, not here, as it's offtopic here. Thank you. Regarding installing the fix, you could ask on the help forums.

st3iny commented 1 year ago

@Gorendal The fix is yet to be released. It will most likely be included in v4.1.1 and any later version.