Repository navigation
fix(federation): persist address book sync token after each page #65941
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,6 +215,19 @@ public function testSetServerStatus(): void { | |
| $this->assertSame(TrustedServers::STATUS_OK, (int)$result[0]['status']); | ||
| } | ||
|
|
||
| public function testSetServerSyncToken(): void { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With only one server in the table, this would still pass if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| $this->dbHandler->addServer('server1'); | ||
| $this->dbHandler->addServer('server2'); | ||
| $this->dbHandler->setServerStatus('http://server1', TrustedServers::STATUS_FAILURE); | ||
|
|
||
| $this->dbHandler->setServerSyncToken('http://server1', 'token1234567890'); | ||
|
|
||
| $servers = array_column($this->dbHandler->getAllServer(), null, 'url'); | ||
| $this->assertSame('token1234567890', $servers['server1']['sync_token']); | ||
| $this->assertSame(TrustedServers::STATUS_FAILURE, (int)$servers['server1']['status']); | ||
| $this->assertNull($servers['server2']['sync_token']); | ||
| } | ||
|
|
||
| public function testGetServerStatus(): void { | ||
| $this->dbHandler->addServer('server1'); | ||
| $this->dbHandler->setServerStatus('http://server1', TrustedServers::STATUS_OK); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-existing, but with this PR it also writes to the DB on every pass:
do … while ($truncated)never ends if the remote keeps answering truncated without moving the token forward. The remote's incremental query usesgte('synctoken', …), so withcarddav_sync_request_truncationset to 1 it returns the token it was given. Anulltoken withtruncated = trueloops as well. Failing the sync when the new token isnullor equal to the previous one would stop it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is out of scope but I fixed it because it can be a big issue.