Hi,
I have build 805 of z-push-2 from SVN, and have encountered a few issues.
requestprocessor.php
First major issue is with a clean slate WM 6.5 phone. I am porting the zimbra backend - but that is not relevant here as far as I can see.
The first folder to try to sync it's contents is the Contacts folder.
It gets a $collection as follows
23/09/2011 16:48:53 [26593] [vincents] [DEBUG] Collection [Array
(
[clientids] => Array
(
)
[modifyids] => Array
(
)
[removeids] => Array
(
)
[fetchids] => Array
(
)
[statusids] => Array
(
)
[class] => Contacts
[synckey] => 0
[collectionid] => f7
[cpo] => ContentParameters Object
(
[contentclass:private] => Contacts
[filtertype:private] =>
[truncation:private] => 9
[rtftruncation:private] =>
[mimesupport:private] =>
[mimetruncation:private] =>
)
[conflict] => 1
[windowsize] => 100
[syncstate] =>
)
]
At line 895
if($status == SYNC_STATUS_SUCCESS && (isset($collection["getchanges"]) || $collection["synckey"] == "0")) {
though $collection["getchanges"] is not set, it passes the test here because $collection["synckey"] == "0"
A new synckey is generated and added to the $collection
[newsynckey] => {34f75c76-c10a-4fa0-b690-ba927a23fba6}1
However, when we get down to line 1031
if($status == SYNC_STATUS_SUCCESS && isset($collection["getchanges"])) {
Only isset($collection["getchanges"] is checked. There is no allowance here for a first time sync. So the block to add the new contacts does not get executed, and the code subsequently bombs out at line 1062 because there is no syncstate.
I believe line 1031 needs to be changed to match line 895
if($status == SYNC_STATUS_SUCCESS && (isset($collection["getchanges"]) || $collection["synckey"] == "0")) {
in order for a first time sync to work.
diffbacknd.php
In diffbackend there are a couple of cosmetic logging bugs that caused me heartache while trying to figure out what the code was doing.
In
class ExportChangesDiff extends DiffState implements IExportChanges{
there are 3 different debug log entries that are prefixed with ImportChangesDiff - an obvious copy/paste error - but when you are new to this structure it has you looking in the wrong places to find out what is going wrong.
Line 568
ZLog::Write(LOGLEVEL_DEBUG,sprintf("ImportChangesDiff->InitializeExporter(): Initializing message diff engine. '%d' messages in state", count($this->syncstate)));
Line 593
ZLog::Write(LOGLEVEL_DEBUG, "ImportChangesDiff->InitializeExporter(): Initializing folder diff engine");
Line 605
ZLog::Write(LOGLEVEL_INFO, sprintf("ImportChangesDiff->InitializeExporter(): Found '%d' changes", count($this->changes) ));
Not Traced Yet
I have a third issue that I haven't been able to fully debug yet.
I have 400+ contacts - and the max window is 100 - but the sync keeps spinning on the first 100 contacts. It never goes on to 101-200, etc.
Vincent
