预览地址中的hash在隧道重建后变化,期望使用 taskId 保持稳定
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 719
- Avg merge
- 4h 30m
- Merged PRs (30d)
- 83
Description
问题描述:
当 VM/agent 重启(或进程重启)后,预览地址中的 hash 会变化,导致用户之前保存/分享的预览链接失效。
根本原因:
preview-relay 在隧道注册时使用随机算法生成 hash,未提供基于业务标识(如 taskId)的确定性 hash 能力。
期望行为:
同一 task 的同一端口,无论重启多少次,预览 URL 保持稳定不变。例如使用 SHA256(taskId + ":" + port) 前 12 位作为 hash。
影响范围:
┌────────────────────────┬──────────┬──────────┐
│ 场景 │ 当前 │ 期望 │
├────────────────────────┼──────────┼──────────┤
│ VM/agent 重启 │ URL 变化 │ URL 不变 │
├────────────────────────┼──────────┼──────────┤
│ 进程崩溃自动恢复 │ URL 变化 │ URL 不变 │
├────────────────────────┼──────────┼──────────┤
│ 手动停启 dev server │ URL 变化 │ URL 不变 │
├────────────────────────┼──────────┼──────────┤
│ 端口转发关闭后重新开放 │ URL 变化 │ URL 不变 │
└────────────────────────┴──────────┴──────────┘
提案方案:
- preview-relay 隧道注册接口增加可选参数 subdomain_hint
- 有值时:hash = SHA256(subdomain_hint + ":" + port)[0:12]
- 无值时:退化为现有随机逻辑(向后兼容)
- backend 和 TaskFlow 逐层透传 taskId
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the preview-relay tunnel registration interface, then trace how backend and TaskFlow pass tunnel parameters. Verify the optional subdomain_hint path, deterministic hash behavior for the same taskId and port, and fallback behavior when it is absent. Done means preview URLs remain stable across restarts while existing callers retain current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100