Implement replaying CalDAV events and calendars
ClosedPublic

Authored by rnicole on Apr 30 2018, 12:55 PM.

Details

Summary

Notes:

  • For calendars, only removal is implemented because:
    • There is no DavCollectionCreateJob, possibly because there can't be an empty DAV collection
    • DavCollectionModifyJob only allows modifying "properties", which we don't use (except for the name, if the name is considered a property)
  • Currently, modifying an item with Sink overrides the one on the server, even if the store is not up-to-date

Diff Detail

Repository
R9 Sink
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rnicole requested review of this revision.Apr 30 2018, 12:55 PM
rnicole created this revision.
cmollekopf requested changes to this revision.Apr 30 2018, 7:58 PM

Looks great =)

I'll test it tomorrow and after that I think we can merge it.

examples/caldavresource/caldavresource.cpp
116

Doesn't seem to be necessary anymore?

141

After removal there is no longer a remote id. Return QByteArray{};

This revision now requires changes to proceed.Apr 30 2018, 7:58 PM
rnicole updated this revision to Diff 33372.May 1 2018, 7:46 AM
rnicole marked 2 inline comments as done.
  • Remove useless comment
  • Return empty ID on event removal

I can't run any of the tests. Are the supposed to be working in the docker container?

Here's an example error:

9: Log:     {deb601d2-a55b-4615-b5d5-9be1baaedbfc}.synchronizer : Synchronizing:  Query ["event"] << Id: ""
9:   Filter: QHash()
9:   Ids: ()
9:   Sorting: ""
9:
9: Warning: {deb601d2-a55b-4615-b5d5-9be1baaedbfc}.default      : "Error  QNetworkReply::NetworkError(ContentNotFoundError) \"Error transferring http://localhost/dav/calendars/users/doe - server replied: Not Found\""
9: Warning: {deb601d2-a55b-4615-b5d5-9be1baaedbfc}.default      : "Error  QNetworkReply::NetworkError(ContentNotFoundError) \"Error transferring http://localhost/dav/calendars/users/doe - server replied: Not Found\""
9: Warning: {deb601d2-a55b-4615-b5d5-9be1baaedbfc}.webdav       : Job failed:  "There was a problem with the request.\nHTTP error (203)." KDAV2::DavCollectionsFetchJob 300
9: Warning: {deb601d2-a55b-4615-b5d5-9be1baaedbfc}.synchronizer : Synchronization failed:  Error:  1 Msg:  "There was a problem with the request.\nHTTP error (203)."
9: Warning: {deb601d2-a55b-4615-b5d5-9be1baaedbfc}.synchronizer : Error during sync:  Error:  1 Msg:  "There was a problem with the request.\nHTTP error (203)."
9: Log:     {deb601d2-a55b-4615-b5d5-9be1baaedbfc}.synchronizer : All requests processed.
9: FAIL!  : CalDavTest::testSyncCalEmpty() Compared values are not the same
9:    Actual   (events.size()): 0
9:    Expected (1)            : 1
9:    Loc: [/src/sink/examples/caldavresource/tests/caldavtest.cpp(83)]
9: FAIL!  : CalDavTest::testSyncCalEmpty() Compared values are not the same
9:    Actual   (calendars.size()): 0
9:    Expected (1)               : 1
9:    Loc: [/src/sink/examples/caldavresource/tests/caldavtest.cpp(88)]

Oh right, I still haven't figured out how to configure Cyrus for CalDAV or how to add test data. My solution was to install a Radicale server, and add a MyCalendar with one event in it. I should have documented this in the test file, but I forgot. I'll fix that

rnicole updated this revision to Diff 33379.May 1 2018, 10:33 AM

Document test requirements

This revision was not accepted when it landed; it landed in state Needs Review.May 3 2018, 9:20 AM
This revision was automatically updated to reflect the committed changes.