Skip to content
Permalink
Browse files

(fix) we now return all cards when we receive an empty addressbook-qu…

…ery REPORT
  • Loading branch information...
extrafu committed Oct 21, 2015
1 parent fc9b175 commit 2c723070c69899055b456119f6e8f42c279d0c57
Showing with 7 additions and 6 deletions.
  1. +1 −0 NEWS
  2. +1 −3 SoObjects/Contacts/SOGoFolder+CardDAV.h
  3. +5 −3 SoObjects/Contacts/SOGoFolder+CardDAV.m
1 NEWS
@@ -13,6 +13,7 @@ Bug fixes
- correctly handle the References header over EAS (#3365)
- make sure English is always used when generating Date headers using EAS (#3356)
- don't escape quoted strings during versit generation
- we now return all cards when we receive an empty addressbook-query REPORT

2.3.2 (2015-09-16)
------------------
@@ -1,8 +1,6 @@
/* NSObject+CardDAV.h - this file is part of SOGo
*
* Copyright (C) 2007 Inverse inc.
*
* Author: Ludovic Marcotte <ludovic@inverse.ca>
* Copyright (C) 2007-2015 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,8 +1,6 @@
/* NSObject+CardDAV.m - this file is part of SOGo
*
* Copyright (C) 2007-2011 Inverse inc.
*
* Author: Ludovic Marcotte <ludovic@inverse.ca>
* Copyright (C) 2007-2015 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -187,6 +185,10 @@ - (NSArray *) _parseContactFilters: (id <DOMElement>) parentNode
[filters addObject: filter];
}

// If no filters are provided, we return everything.
if (![filters count])
[filters addObject: [NSDictionary dictionaryWithObject: @"." forKey: @"mail"]];

return filters;
}

8 comments on commit 2c72307

@rfc2822

This comment has been minimized.

Copy link

replied Oct 21, 2015

Thanks for the quick response!

@kwirk

This comment has been minimized.

Copy link

replied Oct 31, 2015

This seems to only return cards which have an email address?

@kwirk

This comment has been minimized.

Copy link

replied Nov 1, 2015

Proposed change from "." to "%" resolved issue I raised in my previous comment. Taken from http://sogo.nu/bugs/view.php?id=3373

@ethoms

This comment has been minimized.

Copy link
Contributor

replied Jan 22, 2016

I have the same issue as kwirk, only contacts with an email address are returned after doing a reload or using the search.

I first noticed when the contacts synced on my phone via DAVDroid are much less than they should be. So I reloaded the contacts in webmail and bam, most were gone. After a sudden panic I realized I could restore them from backup. After doing so I still seemed to lose them, but only after a reload.

After changing the @"." to @"%" as kwirk suggests, it makes no difference for me, still broken. I also use postgresql. But in a way I'm glad it's not DAVDroid at fault, and it should be fixable fairly easily. I've been concerned that I wouldn't have reliable open source CalDAV/CardDAV sync tool for android, after working well for so long. It disturbs me that as soon as it got mature, they swapped the engine out and it breaks sync with SOGo.

I'll try to patch it myself and report back.

@ethoms

This comment has been minimized.

Copy link
Contributor

replied Jan 22, 2016

What's interesting is that when I apply the above patch (with the @".") to my big production installation that's still on 2.2.14, I don't have the problem. So, there must be another change elsewhere between 2.2.14 and 2.3.6 that has caused this issue.

@ethoms

This comment has been minimized.

Copy link
Contributor

replied Jan 22, 2016

Correction to my last post. The webmail shows all my contacts in 2.2.14, but the DAVDroid sync still only shows contacts with email addresses.

@ethoms

This comment has been minimized.

Copy link
Contributor

replied Jan 22, 2016

Well it seems I'm confusing myself and probably anyone reading my comments. There seem to be more than one bug. The first is the sync issue with DAVDroid. The second is the webmail "Address Book" issue whereby contacts are missing after a "Reload". It just happens that in both cases only contacts with emails are shown.

So I can confirm kwirk's suggestion of changing "." to "%" fixes the sync done on a regular address book by DAVDroid, on both 2.2.14 and 2.3.6. However, the same change breaks Group Directory (Corporate Directory) syncing by DAVDroid.

So, it seems we need a better fix altogether, and there's a new bug with the webmail address book too.

@ethoms

This comment has been minimized.

Copy link
Contributor

replied Jan 23, 2016

OK, I found a complete solution for the DAVDroid (CardDav) sync issue. See the following PR: #187

Please sign in to comment.
You can’t perform that action at this time.