fix: fix inconsistent behavior with threading email messages in the inbox/folders

This commit is contained in:
Max Hao
2026-06-15 23:00:30 +02:00
committed by Linus Rath
parent f7d4f9d53c
commit fd700f412e
8 changed files with 309 additions and 13 deletions
+10
View File
@@ -388,6 +388,16 @@ export class DemoJMAPClient implements IJMAPClient {
return { id: threadId, emailIds: emails.map(e => e.id) };
}
async getThreads(threadIds: string[]): Promise<Thread[]> {
return threadIds
.map(tid => {
const emails = this.data.emails.filter(e => e.threadId === tid);
if (emails.length === 0) return null;
return { id: tid, emailIds: emails.map(e => e.id) };
})
.filter((t): t is Thread => t !== null);
}
async getThreadEmails(threadId: string): Promise<Email[]> {
return this.data.emails
.filter(e => e.threadId === threadId)