@@ -52,6 +52,7 @@ public function syncThemAll(\Closure $callback) {
5252 try {
5353 $ newToken = $ this ->syncService ->syncRemoteAddressBook ($ url , $ cardDavUser , $ addressBookUrl , $ sharedSecret , $ syncToken , $ targetBookId , $ targetPrincipal , $ targetBookProperties );
5454 if ($ newToken !== $ syncToken ) {
55+ // Finish truncated initial sync.
5556 if (strpos ($ newToken , 'init ' ) !== false ) {
5657 $ newToken = $ this ->syncTruncatedAddressBook ($ url , $ cardDavUser , $ addressBookUrl , $ sharedSecret , $ newToken , $ targetBookId , $ targetPrincipal , $ targetBookProperties );
5758 }
@@ -82,7 +83,7 @@ public function syncThemAll(\Closure $callback) {
8283
8384 private function syncTruncatedAddressBook (string $ url , string $ cardDavUser , string $ addressBookUrl , string $ sharedSecret , string $ syncToken , int $ targetBookId , string $ targetPrincipal , array $ targetBookProperties ): string {
8485 $ newToken = $ this ->syncService ->syncRemoteAddressBook ($ url , $ cardDavUser , $ addressBookUrl , $ sharedSecret , $ syncToken , $ targetBookId , $ targetPrincipal , $ targetBookProperties );
85- while (strpos ($ newToken , 'init ' ) !== false ) {
86+ while (strpos ($ newToken , 'init ' ) !== false ) {
8687 $ newToken = $ this ->syncService ->syncRemoteAddressBook ($ url , $ cardDavUser , $ addressBookUrl , $ sharedSecret , $ syncToken , $ targetBookId , $ targetPrincipal , $ targetBookProperties );
8788 }
8889 return $ newToken ;
0 commit comments