Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F19023166
D4878.1741998625.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4878.1741998625.diff
View Options
diff --git a/lib/kolab_sync_storage.php b/lib/kolab_sync_storage.php
--- a/lib/kolab_sync_storage.php
+++ b/lib/kolab_sync_storage.php
@@ -1969,20 +1969,21 @@
);
if ($row = $db->fetch_assoc()) {
- // MariaDB's datetime output includes microseconds, we need to remove them,
- // it must be "Y-m-d H:i:s" format
- $synctime = preg_replace('/\.[0-9]+/', '', $row['synctime']);
+ // Don't use $row['synctime'] for the internal cache.
+ // The synctime of the found row is usually earlier than the requested synctime.
+ // Note: We use internal cache because there's a call to both hasChanges() and
+ // getChangedEntries() in Sync. It's needed until we add some caching on a higher level.
$this->relations[$folderid][$synctime] = json_decode($row['data'], true);
- }
- // Cleanup: remove all records except the current one
- $db->query(
- "DELETE FROM `syncroton_relations_state`"
- . " WHERE `device_id` = ? AND `folder_id` = ? AND `synctime` <> ?",
- $device_key,
- $folderid,
- $synctime
- );
+ // Cleanup: remove all records except the current one
+ $db->query(
+ "DELETE FROM `syncroton_relations_state`"
+ . " WHERE `device_id` = ? AND `folder_id` = ? AND `synctime` <> ?",
+ $device_key,
+ $folderid,
+ $row['synctime'],
+ );
+ }
}
return $this->relations[$folderid][$synctime] ?? null;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 1:30 AM (7 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11312054
Default Alt Text
D4878.1741998625.diff (1 KB)
Attached To
Mode
D4878: Fix relations state cache
Attached
Detach File
Event Timeline
Log In to Comment