Fix JMAP sorting order issues when emails lack receivedAt headers

This commit is contained in:
Maurus Decimus
2026-04-23 16:40:20 +02:00
parent 0c66576378
commit cedefe70bf
2 changed files with 9 additions and 5 deletions

View File

@@ -204,11 +204,14 @@ impl QueryResults {
!set.contains(*b) as u32,
*ascending,
),
SearchComparator::SortedSet { set, ascending } => (
*set.get(a).unwrap_or(&u32::MAX),
*set.get(b).unwrap_or(&u32::MAX),
*ascending,
),
SearchComparator::SortedSet { set, ascending } => {
let missing = if *ascending { u32::MAX } else { 0 };
(
*set.get(a).unwrap_or(&missing),
*set.get(b).unwrap_or(&missing),
*ascending,
)
}
SearchComparator::Field { .. } => continue,
};