Conversations accessible after search matches no msgs: Closes #7274

Two problems: (1) Error was being thrown while mutex was held, causing
the SearchFolder to forever be locked.  (2) INCOMPLETE_MESSAGE Error
was causing list operation to abort prematurely (which in turn was
due to #6604).
This commit is contained in:
Jim Nelson 2013-08-22 12:29:46 -07:00
parent bb726a2a98
commit 4e6e0bb0e8

View file

@ -335,6 +335,7 @@ public class Geary.SearchFolder : Geary.AbstractLocalFolder, Geary.FolderSupport
initial_index = ids.length - 1;
Gee.List<Geary.Email> results = new Gee.ArrayList<Geary.Email>();
Error? fetch_err = null;
if (initial_index >= 0) {
int increment = flags.is_oldest_to_newest() ? -1 : 1;
i = initial_index;
@ -346,14 +347,22 @@ public class Geary.SearchFolder : Geary.AbstractLocalFolder, Geary.FolderSupport
try {
results.add(yield fetch_email_async(ids[i], required_fields, flags, cancellable));
} catch (Error err) {
if (!(err is EngineError.NOT_FOUND))
throw err;
// Don't let missing or incomplete messages stop the list operation, which has
// different symantics from fetch
if (!(err is EngineError.NOT_FOUND) && !(err is EngineError.INCOMPLETE_MESSAGE)) {
fetch_err = err;
break;
}
}
}
}
result_mutex.release(ref result_mutex_token);
if (fetch_err != null)
throw fetch_err;
return (results.size == 0 ? null : results);
}