synchrone / sandstorm-radicale

A calendars and contacts app for Sandstorm.io
https://apps.sandstorm.io/app/8kr4rvyrggvzfvc160htzdt4u5rfvjc2dgdn27n5pt66mxa40m1h
13 stars 3 forks source link

Refresh button does not refresh #12

Closed synchrone closed 8 years ago

synchrone commented 8 years ago

Upon clicking on the refresh button (also time-based refresh) - no actual content is refreshed.

There are 2 requests happening: PROPFIND /radicale/owner/addressbook.vcf/ with a body of:

<?xml version="1.0" encoding="utf-8"?><D:propfind xmlns:D="DAV:"><D:prop><I:settings xmlns:I="http://inf-it.com/ns/dav/"/><D:current-user-privilege-set/><D:displayname/><D:resourcetype/><L:calendar-home-set xmlns:L="urn:ietf:params:xml:ns:caldav"/><R:addressbook-home-set xmlns:R="urn:ietf:params:xml:ns:carddav"/></D:prop></D:propfind>

and another PROPFIND /radicale/owner/addressbook.vcf/ with a body of:

<?xml version="1.0" encoding="utf-8"?><D:propfind xmlns:D="DAV:"><D:prop><I:settings xmlns:I="http://inf-it.com/ns/dav/"/><D:current-user-privilege-set/><D:displayname/><D:supportedlock/><D:resourcetype/><D:supported-report-set/><D:sync-token/><A:calendar-color xmlns:A="http://apple.com/ns/ical/"/><I:headervalue xmlns:I="http://inf-it.com/ns/dav/"/><I:addressbook-color xmlns:I="http://inf-it.com/ns/ab/"/><L:supported-calendar-component-set xmlns:L="urn:ietf:params:xml:ns:caldav"/><R:max-image-size xmlns:R="urn:ietf:params:xml:ns:carddav"/></D:prop></D:propfind>

Same happens with Calendar documents, probably because they're handled by the same code

synchrone commented 8 years ago

Interesting: after importing an .ics file into an empty calendar, infCloud seemed to realize something's changed and successfully refreshed the calendars.

synchrone commented 8 years ago

This is because Radicale reports sync-token is 404 Not Found, thus making synctoken var at infcloud/webdav_protocol.js:1518 an empty string.

Initially it's null, so the first refresh makes it '' and then subsequent refreshes are treated as if it's the same token, since it's empty due to 404.