mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-29 20:52:51 +00:00
fix(app): stop the streaming Markdown spec at a word boundary (#4875)
The mock provider splits "**Bold" into two frames, "**Bo" and "ld". The helper forwarded both back-to-back and asserted the strong span reads "Bold", which only holds when the browser commits both frames to the store in one reducer flush and the message first mounts with "**Bold". When a frame boundary lands between the two tasks the message mounts with "**Bo" and word pacing holds "ld" until the whitespace after it arrives, so the span reads "Bo" until the gate releases. That is the designed behaviour of the reveal, and the batching is up to the browser's task scheduling. Stop after "**Bold text" instead: the space after "Bold" ends the word, so every batching reveals "Bold" and never more than "text". Forcing the frames into separate commits reproduced the CI failure before the change and passes after it.
This commit is contained in:
@@ -36,7 +36,11 @@ export async function requestStreamingMarkdown(agent: StreamingMarkdownAgent): P
|
||||
await agent.client.sendAgentMessage(agent.agentId, "Show the formatted streaming response.");
|
||||
// Exercise late assertions: the producer finishes before the browser consumes its frames.
|
||||
await agent.client.waitForFinish(agent.agentId, 30_000);
|
||||
await agent.stream.showThrough("**Bold");
|
||||
// The mock splits "**Bold" into two frames. Whether they land in one store
|
||||
// commit or two is up to the browser's task scheduling, and word pacing only
|
||||
// releases a word once the whitespace after it has arrived, so stop after
|
||||
// that whitespace: every batching then reveals "Bold" and nothing past "text".
|
||||
await agent.stream.showThrough("**Bold text");
|
||||
}
|
||||
|
||||
export async function expectUnfinishedBold(page: Page): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user