[R1] 接受 /v{N}/ 版本前缀 #1

Closed
opened 2026-11-08 23:06:06 +00:00 by keith · 1 comment
Owner

部署背景

单域名 https://wire.treeden.app:根路径由 wire-webapp 提供静态前端(Express 服务);/api/* 与 /ws/* 由 Caddy 反代到 wire-rs,并剥离前缀(handle_path)。前端配置 BACKEND_REST=https://wire.treeden.app/api、BACKEND_WS=wss://wire.treeden.app/ws。

现象与冒烟证据

前端协商版本后请求 {BACKEND_REST}/v{N}/...。冒烟:/self 200,但 /v6/self 404。

冒烟测试(2026-11-09,wire-rs ccecae5 release 构建):/healthz 200、/api-version 200(supported 0–19,development 19)、POST /register 201、POST /login 200(zuid cookie:Path=/access; Secure; HttpOnly; SameSite=Lax)、GET /self 200、POST /access 200、GET /conversations 200、/await WebSocket 101;而 /v6/self 404、/feature-configs 404、/properties 404、/teams 404、/list-connections 404、/notifications/last 404、/calls/config/v2 404、/system/settings/unauthorized 404、/conversations/list-ids 400(被当作会话 ID 解析)、/mls/public-keys 400(未配置 removal key)。

期望行为

所有路由同时接受 /v{N}/<path>(N 在 supported 范围内),例如通过 nest 或去前缀中间件;超出范围的版本返回与参考实现一致的错误。Caddy 可临时用正则改写顶替,但应在服务端解决。

涉及文件/模块

  • src/http.rs

工作量估计

S(1–2 小时)

## 部署背景 单域名 https://wire.treeden.app:根路径由 wire-webapp 提供静态前端(Express 服务);`/api/*` 与 `/ws/*` 由 Caddy 反代到 wire-rs,并剥离前缀(handle_path)。前端配置 `BACKEND_REST=https://wire.treeden.app/api`、`BACKEND_WS=wss://wire.treeden.app/ws`。 ## 现象与冒烟证据 前端协商版本后请求 `{BACKEND_REST}/v{N}/...`。冒烟:`/self` 200,但 `/v6/self` 404。 冒烟测试(2026-11-09,wire-rs `ccecae5` release 构建):`/healthz` 200、`/api-version` 200(supported 0–19,development 19)、`POST /register` 201、`POST /login` 200(`zuid` cookie:`Path=/access; Secure; HttpOnly; SameSite=Lax`)、`GET /self` 200、`POST /access` 200、`GET /conversations` 200、`/await` WebSocket 101;而 `/v6/self` 404、`/feature-configs` 404、`/properties` 404、`/teams` 404、`/list-connections` 404、`/notifications/last` 404、`/calls/config/v2` 404、`/system/settings/unauthorized` 404、`/conversations/list-ids` 400(被当作会话 ID 解析)、`/mls/public-keys` 400(未配置 removal key)。 ## 期望行为 所有路由同时接受 `/v{N}/<path>`(N 在 supported 范围内),例如通过 nest 或去前缀中间件;超出范围的版本返回与参考实现一致的错误。Caddy 可临时用正则改写顶替,但应在服务端解决。 ## 涉及文件/模块 - `src/http.rs` ## 工作量估计 S(1–2 小时)
Author
Owner

已实现并通过 M11 验收

/v{N}/ 前缀对所有路由生效(N = 0–8),超范围返回 404 unsupported-version(参考文本);/api-version 固定 v8(supported: 0..8、development: [])。

M11 accepted · commit 56437e7 · doc docs/milestones/M11.md · gates: default 886 / test:db 177 (14 suites) / interop 971 / live 14 (×3, no flake) · integration agent 221 real-process assertions.

## 已实现并通过 M11 验收 `/v{N}/` 前缀对所有路由生效(N = 0–8),超范围返回 `404 unsupported-version`(参考文本);`/api-version` 固定 v8(`supported: 0..8`、`development: []`)。 M11 accepted · commit `56437e7` · doc `docs/milestones/M11.md` · gates: default **886** / test:db **177 (14 suites)** / interop **971** / live **14** (×3, no flake) · integration agent 221 real-process assertions.
keith closed this issue 2026-11-09 14:02:14 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
keith/wire-rs#1
No description provided.