Commit graph

62 commits

Author SHA1 Message Date
Markus Unterwaditzer
2e3ebd814a Add test for partial_sync=ignore 2016-10-04 20:40:34 +02:00
Markus Unterwaditzer
8ca5446e02 Fix tests 2016-10-03 19:00:27 +02:00
Markus Unterwaditzer
ffeaf25471 internal implementation of partial_sync 2016-10-03 18:37:32 +02:00
Markus Unterwaditzer
3cf33e5efe Stylefix 2016-10-01 19:09:27 +02:00
Markus Unterwaditzer
34ac29fc2a Add error_callback to sync() 2016-10-01 18:25:17 +02:00
Markus Unterwaditzer
95c6be6aee Remove remove_hash_from_status
This causes too many problems and forces us to weaken further
assumptions. Better to write separate migration tests, but I don't care.
2016-10-01 17:27:44 +02:00
Markus Unterwaditzer
30ab52ea4c Stylefix 2016-09-26 13:28:57 +02:00
Markus Unterwaditzer
5f76c9e720 Another sync refactor 2016-09-26 12:51:49 +02:00
Markus Unterwaditzer
8cbfb69691 Test rollback in sync 2016-09-26 12:51:49 +02:00
Markus Unterwaditzer
cfbc7ec71b Refactor of status handling in sync (#505)
- Using `info.idents` as new status, this saves a few operations where
  no storage actions have to be taken, but the status has to be updated.

- Rename StorageSyncer to _StorageInfo and make it a private API again.

- Ability to pass custom functions for conflict resolution. This part is
  a preparation for #127.
2016-09-18 15:46:56 +02:00
Markus Unterwaditzer
f238a58c85 DAV: Don't violate Storage API (#492)
The implementation of #476 is problematic as it returns None.
`vdirsyncer.sync` has internal assertions that this is a string, which
is why we get a crash like this:

    error: Unknown error occured for cal/markus@unterwaditzer.net:
    error: Use `-vdebug` to see the full traceback.
    debug:   File "/home/untitaker/projects/vdirsyncer/vdirsyncer/cli/tasks.py", line 66, in sync_collection
    debug:     force_delete=force_delete
    debug:   File "/home/untitaker/projects/vdirsyncer/vdirsyncer/sync.py", line 228, in sync
    debug:     action(a_info, b_info, conflict_resolution)
    debug:   File "/home/untitaker/projects/vdirsyncer/vdirsyncer/sync.py", line 276, in inner
    debug:     assert isinstance(dest_etag, (bytes, text_type))

Discovered in #467
2016-08-19 19:58:38 +02:00
Markus Unterwaditzer
97bfccdb44 Stylefix for flake8 update 2016-07-26 21:48:42 +02:00
Markus Unterwaditzer
3228e22621 DAV: Fix behavior when PUT doesn't return ETag (#476)
Thanks to @evert for pointing this out in the #sabredav IRC channel.
2016-06-16 21:40:18 +02:00
Markus Unterwaditzer
a79e30b0b0 Add tests about flaky etags 2016-04-29 20:22:07 +02:00
Markus Unterwaditzer
cf17ac0509 Stylefix 2016-04-29 20:17:27 +02:00
Markus Unterwaditzer
cf225cc038 Add comment 2016-04-29 20:17:01 +02:00
Markus Unterwaditzer
7418acc42f More assertions regarding read_only and sync 2016-04-29 20:14:16 +02:00
Markus Unterwaditzer
cbb1967017 Test read_only in sync 2016-04-29 20:07:27 +02:00
Markus Unterwaditzer
29d7054e82 Stylefix 2016-04-28 22:12:02 +02:00
Markus Unterwaditzer
e7d73da4aa Be conservative with assume() usage 2016-04-28 21:49:39 +02:00
Markus Unterwaditzer
2beb854157 Factor out duplicate UID strategies 2016-04-25 21:48:51 +02:00
Markus Unterwaditzer
9081284f02 Stylefixes 2016-04-25 18:54:28 +02:00
Markus Unterwaditzer
8d9efc3014 Hypothesis tests for sync (#436) 2016-04-24 19:59:35 +02:00
Markus Unterwaditzer
f81f248dde Stylefix 2016-02-17 19:51:18 +01:00
Markus Unterwaditzer
6e9e856aae Better comments 2016-02-16 23:05:00 +01:00
Markus Unterwaditzer
f2a0d07c09 Fix bug in sync if href changes 2016-02-16 22:59:07 +01:00
Markus Unterwaditzer
211ff0e889 Stylefixes 2015-11-28 16:08:17 +01:00
Markus Unterwaditzer
5f80b9f3f6 Fix testcase 2015-11-28 16:07:40 +01:00
Markus Unterwaditzer
b694c3f60c Add testcase for bogus etag changes 2015-11-28 16:05:22 +01:00
Markus Unterwaditzer
b144ae1701 Restructure status layout for more flexibility 2015-11-28 15:41:37 +01:00
Markus Unterwaditzer
3efca22207 Stylefix 2015-11-13 23:57:07 +01:00
Markus Unterwaditzer
ed22764921 Fix bug during prefetch
The idea that prefetching isn't necessary if the other storage can't be
written to is wrong, we still need to prefetch for UID-matching
2015-11-13 23:00:59 +01:00
Markus Unterwaditzer
eb1485d99f Fix test 2015-09-12 16:42:50 +02:00
Markus Unterwaditzer
237aacee7d Deal with unicode UIDs in sync 2015-06-12 02:51:34 +02:00
Markus Unterwaditzer
e5c826ccfd Harden vdirsyncer against changing UIDs
In a strict sense not necessary since UIDs of an item must not be
changed.
2015-06-06 15:40:16 +02:00
Markus Unterwaditzer
df55926c39 Sync rewrite 2015-02-21 14:14:43 +01:00
Markus Unterwaditzer
5ce0d97f91 Remove copyright headers 2015-01-21 13:02:30 +01:00
Markus Unterwaditzer
12098bcc9d Add testcase for moved hrefs. 2015-01-10 22:06:56 +01:00
Markus Unterwaditzer
ccc3dee28b Handle UID conflicts during sync 2015-01-03 16:30:23 +01:00
Markus Unterwaditzer
9b442ebcf3 Enforce read-only attribute 2014-12-27 11:28:31 +01:00
Markus Unterwaditzer
37c2467f59 Stricten testsuite 2014-11-25 15:17:51 +01:00
Markus Unterwaditzer
6bd5bf7422 Simplify sync code
Before deletion, vdirsyncer will now check if the item changed on the
other side, and induce a re-upload if the item did change.

Because of this behavior it is now possible to remove the special-casing
if no status is available.

Fix #128
2014-10-20 17:42:45 +02:00
Markus Unterwaditzer
eb1431e5db Fix all known URL-quoting problems
- Fix #49 -- The old fix caused problems with other servers. The new
  behavior only decodes ``@`` characters.

- ``@`` is now not used when generating a new href, as some servers seem
  to have problems with it (http://sabre.io/dav/character-encoding/).
  This behavior is configurable via the ``unsafe_href_chars`` parameters
  for DAV storages, and is disabled in the testsuite for Radicale and
  ownCloud.

- Decoding of hrefs is also done twice for CarddavStorage.list because
  of owncloud/contacts#581. Vdirsyncer has behaved like that before, but
  not intentionally.

- Storages now don't share their ``_get_href`` methods anymore.
2014-08-06 16:43:23 +02:00
Markus Unterwaditzer
201c840e88 Import beautification 2014-06-19 00:07:54 +02:00
Markus Unterwaditzer
5028d09f61 Add read_only parameter
Just skip any updates when the storage is read-only, write to status
anyway. The change will get reverted in the next sync.

Fix #54
2014-06-12 14:24:00 +02:00
Markus Unterwaditzer
c1eb55c241 Copyright and contributor stuff
Fix #60
2014-05-22 12:50:43 +02:00
Markus Unterwaditzer
ef1f4fd875 Remove assertion of order. 2014-05-14 16:23:39 +02:00
Markus Unterwaditzer
b87abfa4c0 Syncronization without UIDs! 2014-05-14 15:08:31 +02:00
Markus Unterwaditzer
9616f0bbfe Move "obscure" exceptions into their own modules 2014-05-03 00:17:39 +02:00
Markus Unterwaditzer
bb579a8879 Fix some imports 2014-05-02 19:30:38 +02:00