summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-07-13 12:25:08 +0200
committerCarlos Garnacho <carlosg@gnome.org>2021-07-13 12:45:50 +0200
commit246d4190d1c6ab4aa01c416be7106d09bf0dd826 (patch)
treee8d2e7bf73942b83508d441bc9147cba893f8222
parent0f2b8b66f820da677f1cdb73ad1bf44b90246f4c (diff)
downloadtracker-246d4190d1c6ab4aa01c416be7106d09bf0dd826.tar.gz
libtracker-data: Ensure to synchronize cached values after delete
In these paths of TrackerResource insertion handling for single valued properties, we schedule property deletion, but don't synchronize the cache here. Clear the value array contents so future checks match. This is the most direct cause of the warning seen at https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/179, there is a double CREATED event emission going on there, that due to non-atomicity in the file creation operation has those TrackerResources disagreeing in the nfo:fileSize for the file. Being those 2 tracker_resource_set_*() operations, we schedule prior deletes, but at the time of handling the second nfo:fileSize we'd still be thinking there was a value left in the array, due to the lack of sync. Fixes: https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/179
-rw-r--r--src/libtracker-data/tracker-data-update.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 2103271b0..437859af3 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2519,6 +2519,11 @@ delete_all_helper (TrackerData *data,
super_properties++;
}
+ if (subproperty == property) {
+ /* Clear the buffered property values */
+ g_array_remove_range (old_values, 0, old_values->len);
+ }
+
return TRUE;
}