修复轮1:mail 账号列表排序键还原为 name(与 channel/llm 惯例一致),测试改断言集合而非顺序

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TM4kUBvekALu9qqmp7D3wr
This commit is contained in:
xcs
2026-08-26 00:53:28 +08:00
co-authored by Claude Fable 5
parent 5f1e64b4d4
commit d65579c0d8
2 changed files with 8 additions and 8 deletions
@@ -78,13 +78,7 @@ function accountValues(record: MailAccountRecord): typeof mailAccountTable.$infe
export function createMailAccountStore(db: Db): MailAccountStore {
return {
async list() {
/*
* 按 id 排序,不按 name:name 是人填的中文,数据库默认 collation(en_US.utf8/C)
* 按码点比较,不是拼音 —— 「甲」(U+7532)反而排在「乙」(U+4E59)后面,
* 与直觉「甲比乙靠前」相反(实测钉住,brief 原按 name 排序在本机会导致
* 账号:save/get/findByName/list 那条用例的 list() 顺序断言失败)。id 排序稳定、不受地域字符集影响。
*/
const rows = await db.select().from(mailAccountTable).orderBy(mailAccountTable.id);
const rows = await db.select().from(mailAccountTable).orderBy(mailAccountTable.name);
return rows.map(toAccount);
},
async get(id) {