Calendar: CalDAV: ICS export LAST-MODIFIED not updated correctly

Created on 23 Nov 2018  路  4Comments  路  Source: nextcloud/calendar

When calendars are shared, the user can download ICS files or create a subscription link (webcal://)
When comparing the files generated at different moments, the contents does reflect the changes, with the exception of the LAST-MODIFIED field of a VEVENT, which does not change or reflect the actual modification date of the event.

This could cause problems with CalDAV clients relying on the LAST-MODIFIED field of events. The Google Calendar importer might be among these clients. Google does redownload the calendar but the display of the calendar in Google Calendar does not reflect changes to events. Assuming it relies on the value of LAST-MODIFIED it will ignore any changes to that event.

Looking up the event in the database, it seems that the timestamp stored in the oc_calendarobjects table is correct. This suggests that on export either the wrong date is assigned to the last-modified field or something goes wrong in the conversion from Unix Timestamp to date string as used in the ICS file.

Steps to reproduce

  1. Create a calendar and add 1 event.
  2. Share the calendar, and download the ICS file
  3. Change the event and redownload the ICS file

Expected behaviour

In the exported ICS file, the LAST-MODIFIED lemma reflects the last modification date of the event, and thus change between the two exports because of the change to the event.

Actual behaviour

In the exported ICS files, the LAST-MODIFIED lemma is the same in both cases, even when the ICS files are downloaded weeks apart or the events are changed days or weeks ago.

Server configuration

Operating system:
Linux (Ubuntu)

Web server:
Nginx

Database:
PostgreSQL 9.6

PHP version:
PHP 7.0.32-0ubuntu0.16.04.1

Nextcloud version: (see Nextcloud admin page)
Issue occurs in both 13.0.5 as in 14.0.0

Updated from an older Nextcloud/ownCloud or fresh install:
13.0.5 is an updated NextCloud, 14.0.0 is running from the nextcloud docker image.

Where did you install Nextcloud from:
13.0.5 is manually installed, 14.0.0 is the official docker image.

Signing status:


Signing status

Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

for both 13.0.5 and 14.0.0:
No errors have been found

List of activated apps:


App list

Enabled:

  • activity: 2.6.1
  • audioplayer: 2.3.2
  • bookmarks: 0.12.1
  • calendar: 1.6.1
  • comments: 1.3.0
  • contacts: 2.1.5
  • dav: 1.4.7
  • deck: 0.4.1
  • federatedfilesharing: 1.3.1
  • federation: 1.3.0
  • files: 1.8.0
  • files_external: 1.4.1
  • files_markdown: 2.0.4
  • files_pdfviewer: 1.2.1
  • files_sharing: 1.5.0
  • files_texteditor: 2.5.1
  • files_trashbin: 1.3.0
  • files_versions: 1.6.0
  • files_videoplayer: 1.2.0
  • firstrunwizard: 2.2.1
  • gallery: 18.0.0
  • impersonate: 1.0.4
  • logreader: 2.0.0
  • lookup_server_connector: 1.1.0
  • nextcloud_announcements: 1.2.0
  • notes: 2.4.0
  • notifications: 2.1.2
  • oauth2: 1.1.1
  • onlyoffice: 2.0.2
  • password_policy: 1.3.0
  • provisioning_api: 1.3.0
  • serverinfo: 1.3.0
  • sharebymail: 1.3.0
  • socialsharing_email: 1.0.3
  • survey_client: 1.1.0
  • systemtags: 1.3.0
  • theming: 1.4.5
  • twofactor_backupcodes: 1.2.3
  • updatenotification: 1.3.0
  • workflowengine: 1.3.0
    Disabled:
  • admin_audit
  • encryption
  • files_clipboard
  • spreed
  • tasks
  • user_external
  • user_ldap

Nextcloud configuration:


Config report
{
"system": {
"updatechecker": false,
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"cloud.weidestraat.nl",
"onlyoffice.weidestraat.nl"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"overwrite.cli.url": "https:\/\/cloud.weidestraat.nl",
"dbtype": "pgsql",
"version": "13.0.5.2",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"logtimezone": "UTC",
"installed": true,
"theme": "",
"loglevel": 2,
"maintenance": false,
"updater.release.channel": "stable",
"memcache.local": "\OC\Memcache\APCu",
"filelocking.enabled": true
}
}

Are you using external storage, if yes which one: no external storage

Are you using encryption: yes

Are you using an external user-backend, if yes which one: none

Client configuration

Browser:
N/A
Operating system:
N/A

Logs

Web server error log


Web server error log
N/A as no errors occur.

Nextcloud log (data/nextcloud.log)


Nextcloud log
Nothing in the log that could be related to this issue.

Browser log


Browser log
N/A

Edit: grammar correction


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

3 - to review bug

Most helpful comment

The last-modified property is optional and Google Calendar updates calendar feeds correctly when last-modified is missing.
Would it be an option to just remove it from Nextcloud's ics output until a more permanent fix is found?

All 4 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/8766 (Caldav ), https://github.com/nextcloud/server/issues/11301 (Partial calendar export as ICS), https://github.com/nextcloud/server/issues/6291 (Thunderbird/Lightning Events pop up after each caldav update), https://github.com/nextcloud/server/pull/10664 (Update CRL), and https://github.com/nextcloud/server/issues/7761 (Last modified timestamp after cronjob/filescan).

cc @georgehrke

Any ideas, where we could be looking for a potential place to add a solution?

I found this thread https://github.com/Kozea/Radicale/issues/85 and think that it's correct to assume that the server should set the modified date.

However, I know from just a recent decision, that server-side event manipulation has it's drawbacks and is generally not recommended.

If we would have a server method to set the last-modified date, would it be placed within the 3rdparty/sabre folder?

Background is, that I created a script to display a list of events on a website and one option to feed the plugin with events is to supply an ics feed. While it sadly works great with a stream from Google Calendar, events never get updated when using Nextcloud. That's because I implemented the cache to look for the last-modified date which never changes (aside from some clients, that actually set the last-modified attribute).

The last-modified property is optional and Google Calendar updates calendar feeds correctly when last-modified is missing.
Would it be an option to just remove it from Nextcloud's ics output until a more permanent fix is found?

Was this page helpful?
0 / 5 - 0 ratings