fix(question): prevent AskUserQuestion from resetting answers on re-render - #72
Merged
Merged
Conversation
added 2 commits
September 25, 2026 10:10
…ender The picker's reset effect depended on the `questions` array, which is rebuilt whenever the request object reference changes. App recreated the visible question object on every render (inline spread, not memoized), so any unrelated re-render while the question was pending reset the answers to their initial state and jumped back to the first question. - Gate the reset on requestId identity via a ref (reset only on new request) - Memoize visibleQuestionReq in App to avoid recreating the object - Add a regression test for same-request re-renders - Update the inline-permission architecture assertion to verify the permission-over-question intent instead of the old syntax
Commit 38b6af5 added workspace-membership checks to the workspaces resume route, so a missing session short-circuits with 404 before reaching SessionClient. The escaped-exception test still expected 500 for that path and failed CI. Assert 404 for the workspace route; the plain /api/sessions/:id/resume route keeps covering the SESSION_RESUME_FAILED 500 path.
LIUXIN557
force-pushed
the
fix/question-picker-answer-reset
branch
from
September 25, 2026 02:12
eb19905 to
4111ad0
Compare
Collaborator
|
审查发现 1 个需要合并前修复的 P1 问题,本地修复及验证已完成。 问题:认证完成时触发 Hook 数量变化,主界面可能白屏原提交 修复
验证记录
修复将追加到本 PR 分支,随后更新远端 CI 和合并结果。当前工作区保持在 master,未改动无关代码。 |
Move the visible question memo before authentication early returns, add a production App hook-order regression, and cover retained drafts. Record PR 72 review findings and baseline-aware validation.
Keep the existing gap-2 layout and update its stale gap-0 assertion. The integrated frontend suite and build pass; record the baseline cause and final review validation without changing sidebar behavior.
shaohaozhi286
approved these changes
Sep 25, 2026
shaohaozhi286
left a comment
Collaborator
There was a problem hiding this comment.
复审通过,已修复原 PR 中会导致认证切换后主界面崩溃的 P1 问题。
e3106ae2:将visibleQuestionReq的useMemo移到所有认证提前返回之前;新增生产 App 的 Hook 顺序回归,并补充自定义草稿保留检查。84caeeb2:同步master,把原有侧栏样式断言从旧的gap-0对齐到已提交的gap-2,解除合并后 Web CI 的基线失败。- 按请求 UUID 保留回答、切换新请求重置、权限优先级及原有键盘/IME 行为均已覆盖。
- 修复后的完整前端测试通过(2877 条 pass 记录);构建、正则兼容、OpenSpec strict 和差异检查通过。
- 原错误已在真实 React + Chromium 的认证控制流验证中复现;修复后 5 次认证切换和 2 次权限优先级检查通过。
问题与修复过程见前面的审查评论;最终远端 CI 及合并结果以本 PR 后续记录为准。
Collaborator
最终结果:已修复并合并PR #72 已通过复审并合入 问题及修复:
验证结果:
详细过程见首次审查记录和 PR 内的 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
多题 AskUserQuestion 在后台事件触发 App 重新渲染时,会清空已答内容并跳回第一题:父组件重新创建 request 对象,进而重建 questions 数组,触发 QuestionPicker 的重置 effect。
审查还发现原方案把新增 useMemo 放在认证提前返回之后,初次连接成功或输入 token 后会因 Hook 数量变化导致主界面崩溃。该问题已在本 PR 中修复。
改动
验证
问题与修复记录
e3106ae2:修复认证路径的 Hook 顺序,并增加回归。84caeeb2:同步 master,修复主分支原有的侧栏断言,完成整体验证。openspec/changes/fix-question-picker-rerender-state/。