Commit 4e6e0bb0 authored by Jim Nelson's avatar Jim Nelson

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).
parent bb726a2a
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment