画布身份判定粒度是模板名而非围栏——同一消息内两个同模板画布会互相认领保存版
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 来源
排查 #3243 时定位到,**不在该 PR 范围内**,如实单开。
## 缺陷
`checkCanvasFence` 的身份 `key` 只是**模板名(templateKey)**,`accepts` 因此只能判「模板一样」,**不能判「是不是这一个围栏」**。
**后果**:一条消息里两个画布若用**同一个模板 key**,它们会互相认领对方的保存版。
## 与 #3231 的关系
PR #3231 修的是「候选只有一个时**绕过**身份判定」这条旁路。**它没有修「判定粒度不够细」**——粒度仍是模板名。
**10 个画布的场景里出现重复模板 key 很可能**,所以这条不是理论风险。
## 交付要求
- 身份粒度要细到**围栏级**(同一消息内可区分的稳定标识),不是模板级。
- ⚠ **不许用「按出现顺序编号」当身份**——重排、增删、流式重放都会让顺序变化,那会引入一个更隐蔽的错配。
- 反证必做:造一条会红的断言复现「同一消息内两个同模板画布互相认领」,先确认它真的红。
- 判据用**结构事实**(各围栏读回的内容是否与自己一致),不要用截图。
## 关联
#3231(绕过判定,已修)、#3243(本轮消息落库不完整,PR #3248)。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at checkCanvasFence and inspect how templateKey is used to form identity and how accepts matches saved canvases. First add the required structural assertion for two same-template canvases in one message and confirm it fails; done means each fence matches only its own read-back content without using appearance order or screenshots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100