Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F15427113
D4956.id14184.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D4956.id14184.diff
View Options
diff --git a/bin/inspect.php b/bin/inspect.php
--- a/bin/inspect.php
+++ b/bin/inspect.php
@@ -217,6 +217,29 @@
return "Unknown value: $value";
}
+function getContentUids($db, $device_id, $folder_id) {
+ $contentSelect = $db->query(
+ "SELECT contentid FROM `syncroton_content`"
+ . " WHERE `device_id` = ? AND `folder_id` = ?",
+ $device_id, $folder_id
+ );
+
+ $contentUids = [];
+ while ($content = $db->fetch_assoc($contentSelect)) {
+ $contentUids[] = explode('::', $content['contentid'])[1];
+ }
+ return $contentUids;
+}
+
+function getImapUids($imap, $folder) {
+ $imap->select($folder);
+ $index = $imap->search($folder, 'ALL UNDELETED', true);
+ if (!$index->is_error()) {
+ return $index->get();
+ }
+ return [];
+}
+
println("");
foreach ($result as $deviceId => $values) {
println("Device: $deviceId");
@@ -239,6 +262,28 @@
println(" Last sync: " . ($folder['lastsync'] ?? "None"));
println(" Number of syncs: " . ($folder['counter'] ?? "None"));
println(" Filter type: " . filterType($folder['lastfiltertype'] ?? null));
+
+ if ($messageCount != $totalCount && ($modseq == "none" || $modseq == $imapModseq)) {
+ println(" Issue Detected: The sync state seems to be inconsistent. The device should be fully synced, but the sync counts differ.");
+
+ $contentUids = getContentUids($db, $deviceId, $folderId);
+ $imapUids = getImapUids($imap, $folder['name']);
+
+ println(" The following messages are on the server, but not the device");
+ $missingEntries = array_diff($imapUids, $contentUids);
+ foreach ($missingEntries as $uid) {
+ println(" $uid");
+ //TODO get details from imap?
+ }
+
+ println(" The following messages are on the device, but not the server");
+ $e = array_diff($contentUids, $imapUids);
+ foreach ($missingEntries as $uid) {
+ println(" $uid");
+ //TODO get details from the content part?
+ }
+ }
+
println("");
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 22, 7:11 PM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9484599
Default Alt Text
D4956.id14184.diff (2 KB)
Attached To
Mode
D4956: Detect and display sync count inconsistency
Attached
Detach File
Event Timeline
Log In to Comment