Commit graph

4695 commits

Author SHA1 Message Date
Patrick Ohly
9dce6488d6 PBAP: allow configuring format and fields via databaseFormat
With this patch, the databaseFormat can be used as follows:

  [(2.1|3.0)][:][^]propname,propname,...

  3.0 = download in vCard 3.0 instead of the default 2.1
  3.0:^PHOTO = download in vCard 3.0 format, excluding PHOTO
  PHOTO = download in vCard 2.1 format, only the PHOTO

Valid property names are pulled from obexd with ListFilterFields().
2012-08-27 11:51:14 +02:00
Patrick Ohly
03d11362e9 PBAP: fixed dangling reference
Binding a temporary std::string (the result of getDatabase() in this
case) to a const reference is broken, because the temporary instance
will get deleted before the reference.
2012-08-27 11:49:19 +02:00
Patrick Ohly
e0cf4666e3 PBAP: fixed parsing of PullAll result
Pulling the individual vCard out of the result stream was faulty: it
used the end position as length and thus included data from the next
vCard.
2012-08-27 11:47:03 +02:00
Patrick Ohly
808b9ca8be PBAP: don't try to make up stable local IDs
Local IDs across sessions are only useful when we also have useful
revision strings. For debugging it is easier to just enumerate the
contacts. Would be nice to use the same number as in the PBAP session,
but that information is not currently available via obexd (see "PBAP +
two-step download" on Bluez mailing list).

As it stands now, the PBAP backend can only be used in slow syncs
where the engine does the matching. Perhaps that's the right way to do
it, instead of adding redundant code to the backends.
2012-08-27 11:10:48 +02:00
Patrick Ohly
406f5a0d40 local sync: fix timeout with local sync with libdbus
When using libdbus instead of GIO D-Bus (as done by syncevolution.org
binaries and SyncEvolution on Maemo), local sync may have aborted
after 25 seconds when syncing many items with a D-Bus timeout error:

[ERROR] sending message to child failed: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Reported by Toke Høiland-Jørgensen for Harmattan. Somehow not encountered
elsewhere.

Root cause is the use of the default D-Bus timeout of 25 seconds
instead of disabling the timeout altogether. Fixed by using
DBUS_TIMEOUT_INFINITE and INT_MAX as fallback.
2012-08-23 13:57:29 +02:00
Patrick Ohly
92b3196bc6 GDBus GIO: removed dead code 2012-08-23 13:51:09 +02:00
Patrick Ohly
3035254a8a SyncContext: removed dead "SyncModes" code
Not used anywhere, remove it do avoid confusion.
2012-08-17 15:14:09 +02:00
Patrick Ohly
7dadd14d7e Merge remote-tracking branch 'origin/master' into pbap 2012-08-16 19:06:54 +02:00
Patrick Ohly
f7718ebb48 D-Bus server + GIO D-Bus: fix auto-activation (Debian bug #599247)
When syncevo-dbus-server was started on demand by the D-Bus daemon,
then it registered itself with the daemon before it was ready to
serve requests. Only happened in combination with GIO D-Bus and
thus was not a problem before 1.2.99.x.

One user-visible effect was that the GTK UI did select the default
service when it was started for the first time, because it could not
retrieve that information from syncevo-dbus-server.

The fix consists of delaying the name acquisition. That gives the
caller a chance to register D-Bus objects first, before completing the
connection setup. The semantic change is that
dbus_bus_connection_undelay() must be called on new connections which
have a name (a NOP with libdbus).

This patch tries to minimize code changes. The downside of not
changing the GDBusCXX API more radically is that the bus name must be
attached to DBusConnectionPtr, where it will be copied into each
reference to the connection. Hopefully std::string is smart enough to
share the (small) data in this case. Should be solved cleaner once
libdbus support can be deprecated.

A test for auto-activation and double start of syncevo-dbus-server
is also added.
2012-08-13 22:17:38 +02:00
Patrick Ohly
a987801c14 NEWS, autotools: updated for 1.2.99.4 2012-08-07 09:27:21 +02:00
Patrick Ohly
bc71ae15c0 D-Bus libdbus: avoid compiler warning
One method was still virtual, from the time when the class had a base
class. Remove the "virtual" keyword because a) it causes a compiler
warning in recent g++ about a class with non-virtual destructor with a
virtual method and b) it makes the generated code unnecessarily
complex.
2012-08-07 09:12:45 +02:00
Patrick Ohly
e72eeef426 config: improved 'maxlogdirs' documentation
The old explanation made it sound like nothing would get deleted by
default ("If set, ..."). That's not correct, by default only 10
sessions are kept.

Also explain the behavior of deleting intermediate sessions first.
2012-08-07 09:09:18 +02:00
Patrick Ohly
cd2b115040 autotools: let autogen.sh install the INSTALL file
INSTALL is copied unmodified from the autotools when invoking
autogen.sh. No need to have it in git; that just leads to diffs when
using more recent autotools.
2012-08-02 14:00:48 +02:00
Patrick Ohly
32f6f492c0 command line: fixed --export <file name>
When exporting items into a file, the delimiter between items
was missing.

Also adding a test case for this.
2012-08-02 13:58:20 +02:00
Patrick Ohly
fecf9e03cf D-Bus server: fix support for autoSyncDelay > 0
Auto syncing was not getting triggered when using an autoSyncDelay > 0;
by default it is 5 minutes. Thanks to Vladimir Elisseev for reporting
this problem.

The root cause was a "greater than" instead of a "less than"
comparison. This was not found by the tests because they set
autoSyncDelay to zero to speed up testing.

Changing one test (TestSessionAPIsDummy.testAutoSyncNetworkFailure) so
that it uses non-zero autoSyncDelay triggered the problem. Also added
a variation of that test that simulates the "no Connman and no
NetworkManager" setup used by Vladimir.
2012-08-02 13:57:22 +02:00
Patrick Ohly
67d7ce2673 D-Bus testing: further tweaks for failure tests
A hyphen crept into one of the string replacements, thus disabling
it although needed sometimes. Also updated another check to be more
flexible.
2012-08-02 06:38:02 +00:00
Patrick Ohly
a01c094fb6 ActiveSync: ignore ANIVERSARY and BDAY for both Google and Exchange
Still need to figure out a better way to deal with date vs. date/time
changes in BDAY and ANNIVERSARY. Temporarily disabling the check.
2012-08-02 06:36:25 +00:00
Patrick Ohly
cdac0b4b55 testing: setup-syncevolution needs D-Bus
Setting configurations checks for databases and thus needs a working
D-Bus session when EDS is involved.
2012-08-02 06:35:16 +00:00
Rohan Garg
f104db7e2f D-Bus interface XML: fix incorrect numbering of parameter annotation in Session.SetNamedConfig()
The "configuration" parameter is the forth parameter and thus
has index 3 (numbered from zero). Without this patch, Qt cannot
use the method.
2012-07-29 11:39:02 +02:00
Patrick Ohly
117329eae8 D-Bus interface XML: avoid "template" as parameter name
Using "template" as parameter name causes problems for Qt, because the
name gets used in the generated C++ stubs. The earlier solution for
the problem (spelling it as "tmplate") was accidentally removed in
e4bd5bd while preparing 1.2.99.1.

Let's use "getTemplate" instead of "templateName", because the
parameter itself does not actually contain the name; it's just
a boolean.
2012-07-29 11:27:40 +02:00
Patrick Ohly
adde54c510 Revert "Use the newer org.qtproject.QtDBus annotation for DBus interfaces"
This reverts commit 740cd49cbd.

Going back to Qt4 compatible annotations,
as requested by with Rohan offline.
2012-07-29 11:20:56 +02:00
Patrick Ohly
4daf9aa005 Revert "Use org.qtproject.QtDBus.QtTypeName.In3 instead of org.qtproject.QtDBus.QtTypeName.In2"
This reverts commit 2d3153bc48.

Reverting to the Qt 4 compatible annotations and fixing
the accidental removal of the "template" parameter in
this method.
2012-07-29 11:20:24 +02:00
Patrick Ohly
4a7988adac NEWS, configure: updated for 1.2.99.3 2012-07-24 11:11:26 +02:00
Patrick Ohly
428a959af2 EDS: added support for EDS 3.5.x
When compiled against EDS 3.5.x or later, SyncEvolution now uses
the backend code originally written for the EClient API introduced
in EDS 3.2. That code was changed so that it works with the new
include file rules and ESourceRegistry in EDS 3.5.x. Support
for using the EClient API with EDS 3.4 was removed because maintaining
three different flavors of the EDS backend code would be too much
work and not gain much (just the possibility to test the EDSClient
code with 3.4).

At the moment, this is a compile time choice made automatically
by configure. syncevolution.org binaries are compiled against
an older EDS and thus do not work with EDS 3.5.x or later.

EDS 3.5.x handles authentication itself, using a standard system
prompt if necessary. SyncEvolution can no longer provide the password,
and thus the "databaseUser/Password" options have no effect when using
EDS 3.5.x.

The patch leaves code for older EDS almost completely unchanged and
therefore is considered safe for the stable release series leading to
1.3. Using EClient is an all-or-nothing choice now, because the common
EvolutionSyncSource needs to be compiled differently. Thanks to the
reorganized API, a lot more common code for ECal and EBook sources
could be moved into EvolutionSyncSource.
2012-07-24 08:25:20 +00:00
Patrick Ohly
52eff87971 GLib support: added GObjectDestructor
It is needed for a GListCXX of GObjects. It was already mentioned
in that context, but somehow didn't make it into the header file.
2012-07-24 08:22:42 +00:00
Patrick Ohly
a02ee1eb09 testing: ignore object_path leak in GDBus Object Proxy #680505
Found while testing EDS 3.5.x, reported upstream at
https://bugzilla.gnome.org/show_bug.cgi?id=680505
2012-07-24 07:58:03 +00:00
Patrick Ohly
f1e6decdb1 testing: ignore gnetworkmonitor memory leak #676265
Known issue upstream, fix is in glib 2.33.2.
2012-07-24 07:54:52 +00:00
Patrick Ohly
c8956a36fa testing: fixed ActiveSync sync tests for Exchange and Google
The test data must not use X-MOZILLA-HTML, it is not supported
when syncing to an ActiveSync server like Exchange or Google.
2012-07-20 12:56:08 +00:00
Patrick Ohly
2b4a56a8e7 testing: googleeas + ANNIVERSARY
X-EVOLUTION-ANNIVERSARY has the same problem as BDAY: Google
adds a random time to it.
2012-07-20 12:55:06 +00:00
Patrick Ohly
e39cf4c2a3 ActiveSync: added delay for Google testing
The Google servers take a while to propagate changes. Added
10 second delay to get the testing to pass.
2012-07-20 12:54:11 +00:00
Patrick Ohly
f1b14c6418 AutoSync: fixed testing
Instantiating an ActiveSyncSource for testing must work with
empty database names now. Testing no longer forces the
database to be set.

While at it rewrote the code to avoid the explicit pointer.
2012-07-20 12:52:37 +00:00
Patrick Ohly
abc81eb117 ActiveSync: added some debug output
Tracking down account settings can be tricky. Explain it in
a debug message.
2012-07-20 12:51:32 +00:00
Patrick Ohly
fab6ce58ff local sync: don't drop data comparison output on target side
synccompare on the target side of a local sync was invoked with its
output being redirected via an unreliable socket to the local sync
parent. When the output was large, some of it might have been lost.

Fixed by reading the output locally in the syncevo-local-sync process
with reliable output redirection and sending it to the parent via
D-Bus. Execute() does that when both stdout and stderr are redirected
via LogRedirect, which makes sense also for other stdout output.
2012-07-20 10:44:41 +02:00
Patrick Ohly
3eb2186fbd LogRedirect: fixed crash in local sync
When processing stdout from syncevo-local-child in
syncevo-dbus-helper, the LogRedirect class was invoked recursively and
tried to print the same stdout data repeatedly until the
syncevo-dbus-helper crashed due to the infinite recurssion.

The output shouldn't have been sent via stdout in the first place
(will be fixed separately), but nor should LogRedirect have crashed.
Fixed by swapping the data into a temporary buffer and thus not using
it again.
2012-07-20 10:39:45 +02:00
Patrick Ohly
7d00197be0 Execute(): added some debug output
Show which commands are executed and how. Was used to track down
that and why system() was used in syncevo-local-sync.
2012-07-20 10:37:39 +02:00
Patrick Ohly
b1a8f2f0c3 testing: Google Contacts via ActiveSync adds time to BDAY
Google Contacts does not store the 00:00:00 that activesyncd
adds to a date and later returns some different time. Need
to investigate.

In the meantime, ignore BDAY during testing.
2012-07-18 13:38:38 +00:00
Patrick Ohly
f83e5bc8e2 testing: added googleeas = Google Contacts via ActiveSync
Testing shows that compared to Exchange, some additional problems
exist, which are ignored via synccompare:
- FN gets overwritten.
- CATGEORIES are lost.

Not sure whether anything can be done, so let's consider this
permanently broken.

BDAY also gets modified. Perhaps that can be fixed, so a synccompare
workaround will be commit separately so that it can be reverted later.
2012-07-18 13:35:46 +00:00
Patrick Ohly
8fcca74be7 ActiveSync: enable integration testing in all cases
A backend cannot know whether it'll be used together
with a client-test which supports integration testing.
Therefore the backend should always register its tests.
2012-07-18 13:30:33 +00:00
Patrick Ohly
7c27d273a7 testing: stricter Exchange contact tests
X-EVOLUTION-SPOUSE and X-EVOLUTION-ANNIVERSARY were broken
in activesyncd. With a patch they work, so we should test
them again.
2012-07-18 13:28:47 +00:00
Patrick Ohly
81272fefdc ActiveSync: fixed updating of contacts on Google during a sync
Updating failed when using Google because the Synthesis engine
tried to read the existing item in order to merge it with
the update. This failed because Google does not implement the
Fetch command.

Pretending to update the item intelligently avoids that. It
also helps to improve performance of updates with Exchange.
The downside is that syncing with local storages which do
not support all ActiveSync fields will cause data loss.

Need to check whether Exchange-only attributes get lost
also when the local storage supports everything, for
example because activesynd unintentionally removes data.
2012-07-18 13:22:42 +00:00
Patrick Ohly
0f28eb1c62 syncevolution.org: package ActiveSync backend separately
The syncactivesync.so backend file is no longer included in the
syncevolution-bundle archives. It used to be empty anyway and just
marked the ActiveSync backend as not enabled. This was necessary
because the SyncEvolution reference platform, Ubuntu Lucid, does not
have the necessary libs to compile activesyncd.

Now a fully functional backend and activesyncd get compiled on Debian
Wheezy and packaged (outside of the Makefile) as
"syncevolution-activesync" and "activesyncd".

See https://syncevolution.org/wiki/google-contacts-activesync
2012-07-18 13:15:06 +00:00
Patrick Ohly
3cf40abfd0 testing: don't test memos with Mobical (aka Everdroid)
Memos used to work, but now only trigger an unspecific 400 error.
Not sure what is causing it.
2012-07-18 13:12:05 +00:00
Patrick Ohly
487bbfda0a testing: build client-test as executable
Avoid the libtool wrapper around client-test and use -g.
Makes it possible to use the executable without installing
or invoking it first on its compile platform (relevant for
testing under a different platform).
2012-07-18 13:10:12 +00:00
Patrick Ohly
837d0927f5 EDS: updated syncevolution.org packages, incompatible with EDS 3.6, part 2
libebook-1.2-13 = EDS 3.4 was missing in list of acceptable dependencies.
2012-07-18 13:08:36 +00:00
Patrick Ohly
e3ce8f3bf6 D-Bus testing: relaxed D-Bus checks
valgrind apparently got a bit slower. Previous timeouts were too
small, had to be increased to get tests to pass when using valgrind.

Found some more tests which result in unpredictable error messages
when processes failed. Allow multiple outcomes.
2012-07-18 13:05:54 +00:00
Patrick Ohly
e9796468bb ActiveSync: adapted slow sync handling
The error message for "Invalid synchronization key" changed in
activesyncd, now it contains the D-Bus error type as prefix. Fixed by
doing a substring search.

Also, not freeing the GError before trying again is a bug. Apparently
that was ignored earlier, now it triggers an assert.
2012-07-17 09:28:30 +02:00
Patrick Ohly
b083d343c2 testing: fixed eds_task::testConversion for Funambol
Funambol cannot represent "completed: 99%". It turns that
into 100% completed. Therefore the Funambol test data
uses "in-process: 78%". However, that was misspelled as
"in-progress", which caused testConversion to fail.

Not sure anymore why it was spelled like that (perhaps
Funambol used it that way?) and why this did not cause
problems earlier.
2012-07-16 14:45:50 +00:00
Patrick Ohly
f938ae0f0f testing: fixed testAddBothSides for VJOURNAL
"davfile" (= WebDAV on client, file on server) failed for testAddBothSides
and testAddBothSidesRefresh because the DESCRIPTION was different and
was merged on the client, which caused an unexpected update to be sent
to the server instead of just the delete.

Solved as for other kinds of data: avoid the merging by keeping the data
identical.
2012-07-16 14:34:19 +00:00
Patrick Ohly
15f2d03184 autotools: ensure that link lines are complete
As mentioned by Tino Keitel on the mailing list, some libs and
executables were only implicitly linked against libraries that they
called directly. This happened to work by chance because these libraries
ended up in the running executable anyway, due to indirect loading.

To catch such problems, the "make installcheck" was extended:
dpkg-shlibdeps is run, if available, and the error output is scanned
for the messages which indicate that a symbol is used without linking
to the right library (example output below).

Had to fix quite a few _LIBADD lines to pass the test.
Some exceptions are allowed:
- libsmltk depends on the caller providing SySync logging support.
- libneon is intentionally not linked explicitly for syncevolution.org
  binaries, to make resulting binaries work with GNUTLS and OpenSSL.

dpkg-shlibdeps: warning: debian/syncevolution-libs/usr/lib/syncevolution/backends/syncdav.so contains an unresolvable reference to symbol icalparameter_new_from_value_string: it's probably a plugin.
dpkg-shlibdeps: warning: 51 other similar warnings have been skipped (use -v to see them all).
...
dpkg-shlibdeps: warning: symbol dlsym used by debian/libsyncevolution0/usr/lib/libsyncevolution.so.0.0.0 found in none of the libraries.
dpkg-shlibdeps: warning: symbol dlerror used by debian/libsyncevolution0/usr/lib/libsyncevolution.so.0.0.0 found in none of the libraries.
dpkg-shlibdeps: warning: symbol dlopen used by debian/libsyncevolution0/usr/lib/libsyncevolution.so.0.0.0 found in none of the libraries.
2012-07-12 16:11:33 +00:00
Patrick Ohly
aa2bb63cec testing: activesyncd is now hosted on gnome.org 2012-07-12 15:59:03 +00:00