Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many contacts not synchronized #86

Open
MrFly opened this issue Aug 7, 2014 · 1 comment
Open

Many contacts not synchronized #86

MrFly opened this issue Aug 7, 2014 · 1 comment

Comments

@MrFly
Copy link

MrFly commented Aug 7, 2014

Hi,

synchronizing the contacts from SOGo does not work fully. There are only 23 contacts available in rouncube without any error or special log entry. At SOGo I get about 150-200 contacts or so. The 23 available contacts seem to be random. What can I do to find where (and why) this fails? Is there a way for debugging CardDAV plugin in a special way?

Thanks!

@MrFly
Copy link
Author

MrFly commented Aug 7, 2014

Ok, did it myself. I digged a litte in the php code and found the problem: SOGo seems to not provide every vcard as a .vcf link. So the query to the server fails with an empty response. Problem is located at carddav_backend.php at method get_vcard():

public function get_vcard($vcard_id)
{
    $vcard_id = str_replace('.vcf', null, $vcard_id);
    $response = $this->query($this->url . $vcard_id . '.vcf', 'GET');

    return $response;
}

A workaround will be:

public function get_vcard($vcard_id)
{
    $vcard_id = str_replace('.vcf', null, $vcard_id);
    $response = $this->query($this->url . $vcard_id . '.vcf', 'GET');

    if (empty($response)) {
        $response = $this->query($this->url . $vcard_id, 'GET');
    }
    return $response;
}

So we simply have to try a second time without .vcf to get the vcard. This is not a real solution, because we should really try to avoid double requests, but works for now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant