Skip to content

[Bug]: Chrome extension recorder drops input events during quick field changes or Stop #3191

Description

@dakjdakd

Version

Midscene 1.13.3 (ea75076b5), using the Chrome extension recorder.

Details

Text entered during a short recording can disappear from the timeline and the generated replay. Two sequences expose it: entering values in different fields within a few hundred milliseconds, and clicking Stop immediately after entering a value.

The recorder uses one 300 ms input timer for the whole page. A new input event cancels that timer even when it comes from a different element, so the first field is never reported. stop() also cancels the timer without emitting its pending value. Downstream, the extension bridge has a 200 ms send debounce that forwards only the latest event in that window. A quick click or another event can therefore hide an input even after the recorder has emitted it.

Actual behavior: the earlier field or the final value is missing from the recorded steps. A form replay generated from that recording can skip a required field, although the user did enter it.

Expected behavior: each field retains its latest value, events keep their original order, and Stop includes every input made before it was clicked. Batching repeated keystrokes in the same field should still produce one useful step.

The fix should flush a pending input when the target changes, before recording a click, and when recording stops. The bridge should forward every event accumulated during its send window in order, then finish the final send before acknowledging Stop. This is implemented in PR #3192.

Reproduce link

Input batching in the 1.13.3 recorder source

Reproduce Steps

  1. Open a page with two text inputs and start recording with the Chrome extension.
  2. Set the first input to alpha and dispatch a bubbling input event. Within 300 ms, set the second input to beta and dispatch the same event. Calling input.dispatchEvent(new Event('input', { bubbles: true })) for each field in immediate succession makes the timing repeatable.
  3. Inspect the recorded steps. The first field's alpha input is absent, while the second field's beta input appears.
  4. Start a fresh recording. Enter a value in one input and click Stop before the 300 ms input delay expires. The final input is absent from that recording as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions