Repository navigation
test(webui): wait for the fork title's suggestion before typing it - #247
Merged
Merged
Conversation
The forked session's title came out as the suggested title with the typed name appended to it: "1 - Message actions before refresh.synthetic-message-fork" instead of "synthetic-message-fork". Playwright's fill() is not one assignment on a text input. The injected fill() falls through to selectText() and answers "needsinput", and the server then inserts the text with keyboard.insertText() in a second round trip. The suggested title arrives with the fork options, so it can land between those two steps. The HTML value setter moves the text entry cursor position to the end of the control, so the selection collapses and the insert appends to the suggestion instead of replacing it. The client is right to keep a name a person typed: the late reply is skipped once the field has been edited. But this case typed nothing until the suggestion had already landed, and it typed through fill()'s two steps, so the suggestion was still unwritten when the guard looked at it. Wait for the fork options' reply, and for the suggestion to be in the field, before typing. The assertion is unchanged: the fork request must carry the typed name and must not carry the suggestion.
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.
The forked session's title came out as the suggested title with the typed name appended to it:
instead of
"synthetic-message-fork".Playwright's
fill()is not one assignment on a text input. The injectedfill()falls through toselectText(element)and answers"needsinput", and the server then inserts the text withkeyboard.insertText()in a second round trip. The suggested title arrives with the fork options, so it can land between those two steps. The HTML value setter moves the text entry cursor position to the end of the control, so the selection collapses and the insert appends to the suggestion instead of replacing it.The client is right to keep a name a person typed: the late reply is skipped once the field has been edited. But this case typed nothing until the suggestion had already landed, and it typed through
fill()'s two steps, so the suggestion was still unwritten when the guard looked at it.Wait for the fork options' reply, and for the suggestion to be in the field, before typing. The assertion is unchanged: the fork request must carry the typed name and must not carry the suggestion.