[Sugar-devel] datastore results inconsistency

Daniel Drake dsd at laptop.org
Fri Jun 26 12:57:59 EDT 2009


Hi Tomeu,

I found the issue with the journal showing a duplicated entry after
hand-deleting a datastore entry.

It's an issue in the datastore, in the same function: DataStore.find()

After your patch, we now weed out the entries that don't exist on-disk,
but we still return "count" items (which is not adjusted accordingly)

My suggested fix: decrement count in the loop if the file does not
exist.

for uid in uids:
    if os.path.exists(layoutmanager.get_instance().get_entry_path(uid)):
        metadata = self._metadata_store.retrieve(uid, properties)
        entries.append(metadata)
+   else:
+       count = count - 1

Daniel




More information about the Sugar-devel mailing list