Projects
Kolab:16:Testing
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 41
View file
kolab-syncroton.spec
Changed
@@ -37,7 +37,7 @@ %global upstream_version 2.4.2 Name: kolab-syncroton -Version: 2.4.2.15 +Version: 2.4.2.16 Release: 1%{?dist} Summary: ActiveSync for Kolab Groupware
View file
debian.changelog
Changed
@@ -1,4 +1,4 @@ -kolab-syncroton (2.4.2.15-0~kolab1) unstable; urgency=low +kolab-syncroton (2.4.2.16-0~kolab1) unstable; urgency=low * Release version 2.4.2
View file
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_storage.php
Changed
@@ -1269,17 +1269,17 @@ /** * Return extra data that is stored with the sync key and passed in during the search to find changes. * - * @param string $folderid Folder identifier - * @param string $deviceid Device identifier + * @param string $folderid Folder identifier + * @param string $deviceid Device identifier * - * @return string|null Extra data + * @return string|null Extra data (JSON-encoded) */ public function getExtraData($folderid, $deviceid) { //We explicitly return a cached value that was used during the search. //Otherwise we'd risk storing a higher modseq value and missing an update. - if (array_key_exists($deviceid, $this->modseq) && $value = $this->modseq$deviceid$folderid) { - return json_encode('modseq' => intval($value)); + if (isset($this->modseq$deviceid$folderid)) { + return json_encode('modseq' => intval($this->modseq$deviceid$folderid)); } //If we didn't fetch modseq in the first place we have to fetch it now.
View file
kolab-syncroton-2.4.2.tar.gz/tests/Sync/Sync/EmailITipTest.php
Added
@@ -0,0 +1,81 @@ +<?php + +namespace Tests\Sync\Sync; + +class EmailITipTest extends \Tests\SyncTestCase +{ + /** + * Test Sync with invalid itip + */ + public function testSyncWithInvalidITip() + { + $this->emptyTestFolder('INBOX', 'mail'); + $this->registerDevice(); + + // Test INBOX + $folderId = '38b950ebd62cd9a66929c89615d0fc04'; + $syncKey = 0; + $request = <<<EOF + <?xml version="1.0" encoding="utf-8"?> + <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/"> + <Sync xmlns="uri:AirSync"> + <Collections> + <Collection> + <SyncKey>{$syncKey}</SyncKey> + <CollectionId>{$folderId}</CollectionId> + </Collection> + </Collections> + </Sync> + EOF; + + $response = $this->request($request, 'Sync'); + $this->assertEquals(200, $response->getStatusCode()); + $syncKey++; + + // Append messages + $this->appendMail('INBOX', 'mail.itip1'); + $this->appendMail('INBOX', 'mail.itip.invalid'); + $this->appendMail('INBOX', 'mail.sync2'); + + // Test that the synchornization works with the invalid itip in the middle + $request = <<<EOF + <?xml version="1.0" encoding="utf-8"?> + <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/"> + <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"> + <Collections> + <Collection> + <SyncKey>{$syncKey}</SyncKey> + <CollectionId>{$folderId}</CollectionId> + <DeletesAsMoves>1</DeletesAsMoves> + <GetChanges>1</GetChanges> + <Options> + <FilterType>0</FilterType> + <Conflict>1</Conflict> + <BodyPreference xmlns="uri:AirSyncBase"> + <Type>2</Type> + <TruncationSize>51200</TruncationSize> + <AllOrNone>0</AllOrNone> + </BodyPreference> + </Options> + </Collection> + </Collections> + </Sync> + EOF; + + $response = $this->request($request, 'Sync'); + + $this->assertEquals(200, $response->getStatusCode()); + + $dom = $this->fromWbxml($response->getBody()); + $xpath = $this->xpath($dom); + + // print($dom->saveXML()); + + $root = "//ns:Sync/ns:Collections/ns:Collection"; + $this->assertSame('1', $xpath->query("{$root}/ns:Status")->item(0)->nodeValue); + $this->assertSame(strval(++$syncKey), $xpath->query("{$root}/ns:SyncKey")->item(0)->nodeValue); + $this->assertSame($folderId, $xpath->query("{$root}/ns:CollectionId")->item(0)->nodeValue); + // We expect all three messages to synchronize, even if we fail to parse the invitation in the middle + $this->assertSame(3, $xpath->query("{$root}/ns:Commands/ns:Add")->count()); + } +}
View file
kolab-syncroton-2.4.2.tar.gz/tests/SyncTestCase.php
Changed
@@ -7,6 +7,7 @@ protected static ?\GuzzleHttp\Client $client; protected static ?string $deviceId; protected static ?string $deviceType; + protected static ?string $host; protected static ?string $username; protected static ?string $password; protected static bool $authenticated = false; @@ -36,6 +37,7 @@ self::$username = $config->get('activesync_test_username'); self::$password = $config->get('activesync_test_password'); + self::$host = $config->get('activesync_test_host', 'http://localhost:8000'); if (empty(self::$username)) { return; @@ -48,12 +50,11 @@ $db->query('DELETE FROM syncroton_folder'); $db->query('DELETE FROM syncroton_data'); $db->query('DELETE FROM syncroton_data_folder'); - $db->query('DELETE FROM syncroton_modseq'); $db->query('DELETE FROM syncroton_content'); self::$client = new \GuzzleHttp\Client( 'http_errors' => false, - 'base_uri' => 'http://localhost:8000', + 'base_uri' => self::$host, 'verify' => false, 'auth' => self::$username, self::$password, 'connect_timeout' => 10,
View file
kolab-syncroton-2.4.2.tar.gz/tests/src/mail.itip.invalid
Added
@@ -0,0 +1,51 @@ +MIME-Version: 1.0 +Date: Thu, 07 Dec 2023 13:29:14 +0100 +Message-ID: <14ab307198d32cee00b38ffb54c9e577@nestle.kolab.ch> +From: "Organizer" <$from> +To: <$to> +Subject: Invalid itip invitation +Content-Type: multipart/alternative; + boundary="=_f39ac9438326f676a8d562e163aa31e0" + +--=_f39ac9438326f676a8d562e163aa31e0 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; charset=UTF-8; + format=flowed + +*Test* +--=_f39ac9438326f676a8d562e163aa31e0 +Content-Transfer-Encoding: 8bit +Content-Type: text/calendar; charset=UTF-8; method=REQUEST; name=event.ics + +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//Roundcube 1.5-git//Sabre VObject 4.5.3//EN +CALSCALE:GREGORIAN +METHOD:REQUEST +BEGIN:VTIMEZONE +TZID:Europe/Warsaw +BEGIN:DAYLIGHT +DTSTART:20230326T010000 +TZOFFSETFROM:+0100 +TZOFFSETTO:+0200 +TZNAME:CEST +END:DAYLIGHT +BEGIN:DAYLIGHT +DTSTART:20240331T010000 +TZOFFSETFROM:+0100 +TZOFFSETTO:+0200 +TZNAME:CEST +END:DAYLIGHT +BEGIN:STANDARD +DTSTART:20231029T010000 +TZOFFSETFROM:+0200 +TZOFFSETTO:+0100 +TZNAME:CET +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +DTSTART;TZID=Europe/Warsaw:20231207T140000 +END:VEVENT +END:VCALENDAR + +--=_f39ac9438326f676a8d562e163aa31e0--
View file
kolab-syncroton.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-syncroton Binary: kolab-syncroton Architecture: all -Version: 1:2.4.2.15-1~kolab1 +Version: 1:2.4.2.16-1~kolab1 Maintainer: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Uploaders: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Homepage: http://www.kolab.org/
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.