initial_messages leaks messages across sessions: the mutable Field.default list is shared by every State instance
@FarhanAliRaza 已经在做这个了。
开始于 2026年10月30日。
评估
调研方向
从 initial_messages 的处理和 thirdparty_a2/probes/mutable_default_probe 中的可变默认值探测开始;issue 没有指出应用源文件或测试。先运行双上下文聊天复现,检查独立的状态实例是否仍共享同一个列表。完成标准是每个会话在 /chat-initial 和 /chat 中只能看到自己的消息。
由索引模型根据 Issue 内容生成。
描述
Severity: MEDIUM, pre-existing (reflex 0.9.12, 0.10.0a1 and 0.10.0a2 with reflex-chat 0.0.2a1).
Two browser sessions: session B sees session A's /chat-initial message (on 0.9.12 the leak also reaches /chat). The list passed as initial_messages ends up as a mutable Field.default that every state instance shares, so one session's appends are visible to all. Use a default factory / copy the list per instance.
Repro: thirdparty_a2/probes/mutable_default_probe and the tp_components chat page driven in two contexts; evidence thirdparty_a2/out/components/*-chat-leak.txt in https://github.com/reflex-dev/reflex/blob/claude/reflex-prerelease-testing-t0sd90/prerelease_testing/2026-10-07/thirdparty_a2/NOTES.md (finding F-009 of the 2026-10-06 pre-release QA, re-verified on 2026-10-07).
- 主要语言
- Python
- 星标
- 342
- 派生
- 84
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
todo
难度 1/5 1 小时以内 新手友好度 72/100
tonybaloney/CSnakes#864 ·
-
infra
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
libre-embedded/svgen#72 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
Genesis-Embodied-AI/genesis-world#3950 ·
维护者通常 1 天内回复
-
accessibility
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复