server: sort catchup ids by timestamp across all sources

This commit is contained in:
Bill Thiede 2025-02-24 17:08:57 -08:00
parent e1a502ac4b
commit 9bf53afebf

View File

@ -331,10 +331,15 @@ impl QueryRoot {
notmuch_results.len(),
);
let results: Vec<_> = newsreader_results
let mut results: Vec<_> = newsreader_results
.into_iter()
.chain(notmuch_results)
.collect();
// The leading '-' is to reverse sort
results.sort_by_key(|item| match item {
ThreadSummaryCursor::Newsreader(_, ts) => -ts.timestamp,
ThreadSummaryCursor::Notmuch(_, ts) => -ts.timestamp,
});
let ids = results
.into_iter()
.map(|r| match r {