searchAddresses (used by the To/Cc/Bcc autocomplete) now runs two passes over the candidate email rows:
Sent-folder rows first — the mailboxes table is queried for mailboxes with role='sent'; any email row whose mailboxPath matches gets processed before inbox/other rows. Within this group addresses are ordered by receivedAt DESC as before.
All other rows — processed after sent rows, also by receivedAt DESC.
Within sent-folder rows, toAddresses and ccJson are checked before fromJson (the sender in a sent email is our own address, not a useful suggestion). For non-sent rows the original order (fromJson, toAddresses, ccJson) is kept.
This means: if you wrote to info@foo.de yesterday and received spam from info@spam.de today, typing "i" surfaces info@foo.de first.
How verified
All 492 unit tests pass (task test).
Added a dedicated test searchAddresses prioritises sent-folder addresses over newer received that inserts an older sent email and a newer received email matching the same query prefix and asserts the sent-folder address is returned first.
## What changed
`searchAddresses` (used by the To/Cc/Bcc autocomplete) now runs two passes over the candidate email rows:
1. **Sent-folder rows first** — the mailboxes table is queried for mailboxes with `role='sent'`; any email row whose `mailboxPath` matches gets processed before inbox/other rows. Within this group addresses are ordered by `receivedAt` DESC as before.
2. **All other rows** — processed after sent rows, also by `receivedAt` DESC.
Within sent-folder rows, `toAddresses` and `ccJson` are checked before `fromJson` (the sender in a sent email is our own address, not a useful suggestion). For non-sent rows the original order (`fromJson`, `toAddresses`, `ccJson`) is kept.
This means: if you wrote to `info@foo.de` yesterday and received spam from `info@spam.de` today, typing "i" surfaces `info@foo.de` first.
## How verified
- All 492 unit tests pass (`task test`).
- Added a dedicated test `searchAddresses prioritises sent-folder addresses over newer received` that inserts an older sent email and a newer received email matching the same query prefix and asserts the sent-folder address is returned first.
Closes #375
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What changed
searchAddresses(used by the To/Cc/Bcc autocomplete) now runs two passes over the candidate email rows:role='sent'; any email row whosemailboxPathmatches gets processed before inbox/other rows. Within this group addresses are ordered byreceivedAtDESC as before.receivedAtDESC.Within sent-folder rows,
toAddressesandccJsonare checked beforefromJson(the sender in a sent email is our own address, not a useful suggestion). For non-sent rows the original order (fromJson,toAddresses,ccJson) is kept.This means: if you wrote to
info@foo.deyesterday and received spam frominfo@spam.detoday, typing "i" surfacesinfo@foo.defirst.How verified
task test).searchAddresses prioritises sent-folder addresses over newer receivedthat inserts an older sent email and a newer received email matching the same query prefix and asserts the sent-folder address is returned first.Closes #375