test(chat): the stop-settlement refs moved to consultation-run-refs (BUG-1642)
The Python source contract still looked for the two useRef lines in page.tsx;
BUG-1642 moved them to module-level refs so a run outlives Home. Same types
and initial values, new location. This turned the staging gate red on
8c08ed74.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
This commit is contained in:
@@ -170,8 +170,15 @@ def test_chat_page_uses_authenticated_cloud_persistence() -> None:
|
||||
# The user turn is still appended unless the question is already present.
|
||||
assert 'messages: questionAlreadyPresent ? preservedMessages : [...preservedMessages, { role: "user", text: question }]' in source
|
||||
assert 'await persistSession(completedSession)' in source
|
||||
assert 'const stoppedRequestAwaitingSettlement = useRef<string | null>(null)' in source
|
||||
assert 'const stoppedSessionPersistence = useRef(new Map<string, Promise<void>>())' in source
|
||||
# 原值: page.tsx 里 `const stoppedRequestAwaitingSettlement = useRef<string | null>(null)` 与
|
||||
# `const stoppedSessionPersistence = useRef(new Map<string, Promise<void>>())`
|
||||
# 新值: 两个引用搬到模块级 consultation-run-refs.ts,page.tsx 从 consultationRunRefs() 取
|
||||
# 原因: BUG-1642,进行中的回答要跨越 Home 卸载 / 重挂;引用本身的类型和初值不变。
|
||||
run_refs = (Path(__file__).resolve().parents[1] / "frontend" / "src" / "lib" / "consultation-run-refs.ts").read_text(encoding="utf-8")
|
||||
assert "} = consultationRunRefs();" in source
|
||||
assert "stoppedRequestAwaitingSettlement," in source and "stoppedSessionPersistence," in source
|
||||
assert "readonly stoppedRequestAwaitingSettlement: MutableRefObject<string | null>;" in run_refs
|
||||
assert "readonly stoppedSessionPersistence: MutableRefObject<Map<string, Promise<void>>>;" in run_refs
|
||||
# Former values: persist interruptedSession when `ownsInterface && !partialReply`.
|
||||
# Interrupted answers stay in page memory; the client does not replace the server transcript.
|
||||
assert "await persistSession(interruptedSession)" not in source
|
||||
|
||||
Reference in New Issue
Block a user