[R4] self 会话与 1:1 会话的最小后端实现 #4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
部署背景
单域名 https://wire.treeden.app:根路径由 wire-webapp 提供前端;
/api/*与/ws/*由 Caddy 反代到 wire-rs 并剥离前缀(handle_path)。前端配置BACKEND_REST=https://wire.treeden.app/api、BACKEND_WS=wss://wire.treeden.app/ws。对接原则
前端尽量不改,由后端适配;后端保持最小,前端启动链路之外的接口返回空值或默认值。
API 版本约定
前端
MAX_API_VERSION默认 17(libraries/config/src/client.config.ts),wire-rs/api-version宣称 0–19,协商结果为 17。部署时固定MAX_API_VERSION=8,后端/api-version宣称与之匹配的 supported 范围(上限 8),桩接口按该版本的路径实现;以下路径均为剥离/v{N}之后的形式。v7 起 1:1 路径为/one2one-conversations/...(libraries/api-client/src/conversation/conversationApi/conversationApi.ts)。现象
wire-rs 只有 MLS 群会话。前端启动时调用
initialiseSelfAndTeamConversations(apps/webapp/src/script/mls/),通过GET /conversations/mls-self取 MLS self 会话并建/入 self group;打开与某人的 1:1 时通过GET /one2one-conversations/{domain}/{uid}(v7+)取 MLS 1:1 会话。两者缺失会导致客户端初始化失败或无法私聊。期望行为(前端零改动)
self 会话
GET /conversations/mls-self→ 200,每个用户懒创建一条:type=1(self)、protocol:"mls"、group_id(随机 32 字节 base64)、epoch:0、cipher_suite:1、members.self为本人、others:[]。group_id发送 commit bundle(epoch 0 → 1);POST /mls/commit-bundles需接受 self 会话(成员仅本人的多个设备),并产生 Welcome/事件推送给本人其他设备。POST /conversations/list-ids结果中。1:1 会话
GET /one2one-conversations/{domain}/{uid}(同时接受/conversations/one2one/{domain}/{uid})→ 200,返回{"conversation":<Conversation>,"public_keys":{"removal":{"ed25519":"<base64>"}}}(MLS1to1Conversation形状)。type=2(one2one)、protocol:"mls"、epoch:0起始;首次由任一方建组并 commit。/list-connections返回空),即任何已注册用户可直接建立 1:1。POST /one2one-conversations(Proteus 建 1:1)→ 400{"code":400,"label":"mls-only","message":"Proteus is not supported"},前端在 MLS 默认协议下不会调用。涉及文件/模块
src/conversations/(self、one2one 查询与懒创建)src/mls/(commit-bundle 对 self/1:1 的成员校验)src/http.rsmigrations/(会话类型字段或约束)README.md工作量
M(1–2 天)
keith referenced this issue from keith/wire-webapp2026-11-08 23:06:07 +00:00
[R4] self 会话(MLS self group)to [R4][必需] self 会话与 1:1 会话的最小后端实现[R4][必需] self 会话与 1:1 会话的最小后端实现to [R4] self 会话与 1:1 会话的最小后端实现已实现并通过 M11 验收
GET /conversations/mls-self:每用户懒创建type=1、protocol=mls、epoch=0,接受 0→1 commit 并向本人其他设备扇出 Welcome/事件。GET /one2one-conversations/{domain}/{uid}:会话 ID 采用参考one2OneConvIdSHA256 算法(三方交叉验证固定向量),type=2、epoch=0,任一方首次建组 commit;无连接请求流程。POST /one2one-conversations→ 400mls-only。已知偏差:self/1:1 的
group_id为随机 32B(参考为确定性);access_role=[];GET /conversations/{cid}对本人 UUID 存在 create-on-read 写副作用。M11 accepted · commit
56437e7· docdocs/milestones/M11.md· gates: default 886 / test:db 177 (14 suites) / interop 971 / live 14 (×3, no flake) · integration agent 221 real-process assertions.