-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(dav): Add retention time to sync token cleanup #44075
Conversation
@tcitworld does this makes sense? |
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.
LGTM
@@ -52,9 +52,10 @@ public function __construct(ITimeFactory $timeFactory, CalDavBackend $calDavBack | |||
|
|||
public function run($argument) { | |||
$limit = max(1, (int) $this->config->getAppValue(Application::APP_ID, 'totalNumberOfSyncTokensToKeep', '10000')); | |||
$retention = max(7, (int) $this->config->getAppValue(Application::APP_ID, 'syncTokensRetention', '60')) * 24 * 3600; |
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.
$retention = max(7, (int) $this->config->getAppValue(Application::APP_ID, 'syncTokensRetention', '60')) * 24 * 3600; | |
$retention = max(7, (int) $this->config->getAppValue(Application::APP_ID, 'syncTokensRetentionDays', '60')) * 24 * 3600; |
Make the name explicit the unit
/backport to stable28 |
/backport to stable27 |
/backport to stable26 |
@@ -52,9 +52,10 @@ | |||
|
|||
public function run($argument) { | |||
$limit = max(1, (int) $this->config->getAppValue(Application::APP_ID, 'totalNumberOfSyncTokensToKeep', '10000')); | |||
$retention = max(7, (int) $this->config->getAppValue(Application::APP_ID, 'syncTokensRetentionDays', '60')) * 24 * 3600; |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
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.
Thanks, Psalmy. I want to backport
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.
backport ease vs. future tech debt
⚖️
The never ending balancing act...
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.
I'll send a PR when this is in
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.
LGTM
3054011
to
4ddd76c
Compare
|
3d68b2d
to
f3e295f
Compare
Fixed existing tests and added two new assertions that assert all data is kept when the retention threshold is timestamp=0. |
There is still some errors in CI |
f3e295f
to
77e2c60
Compare
Addressed. Now CardDAV has the same new test to assert the logic keeps historic data :) |
f84412a
to
dd35045
Compare
apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php
Outdated
Show resolved
Hide resolved
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
dd35045
to
3dea99f
Compare
Summary
This is a refinement of #31064. We keep 10k sync changes by default. The larger the user base, the fewer sync tokens can be stored per user on average. E.g. if you have an installation of 5k active calendar users, each of them can only keep 2 sync changes. This leads to synchronization problems with Thunderbird and similar.
This change adds timestamp tracking to changes and only deletes changes older than 60 days. The retention period is configurable. 7 days is the minimum.
TODO
Checklist