Conversation
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.
Fixes #3191.
The Chrome extension recorder could lose an input when someone moved between fields quickly or stopped immediately after typing. The recorder's 300 ms timer belonged to the whole page, so input in field B replaced a pending event for field A. The extension bridge then had its own 200 ms debounce and sent only the last event it had received. Together, those two batching steps could leave the timeline, and a replay generated from it, without a value the user entered.
The recorder now keeps the latest pending input event and flushes it before a click, when input moves to another element, and during Stop. Consecutive keystrokes in the same field remain batched; the event records the value and timestamp from the input that produced it. Flushing before a click also keeps the input ahead of the action that followed it.
In the bridge, the send window now forwards every unsent event in order instead of forwarding just its last event. Sends are serialized, and Stop waits for the final batch before replying. The bridge also recognizes an updated last event when the recorder optimizer merges consecutive input from the same field. The resulting timeline retains both fields in a quick A-to-B sequence and the last value entered before Stop, so generated replay steps have the inputs they need.
The regression tests cover rapid input across two fields, an input followed immediately by Stop, and delivery of multiple buffered events through the bridge before Stop is acknowledged.
Validation:
pnpm run lintpnpm exec nx build @midscene/sharedpnpm exec nx build @midscene/recorder-uipnpm --filter chrome-extension exec rstest run tests/recorder-input.test.ts tests/event-recorder-bridge-input.test.ts(3 tests passed)