Skip to content

Demo does not handle undo/redo events #1254

@garyg1

Description

@garyg1

In the demo on https://jsonnet.org, if you hit redo/undo for multiple characters, the demo breaks. This seems to be because the browser generates multiple text change events (Chrome 139, MacOS 14.6).

Currently, the implementation of the click handler in aux_demo does not synchronize to deduplicate these events, resulting in duplicate or untracked tabs being added to the demo. Because aux_demo calls await (which yields) the DOM call order becomes clear-clear-add-add instead of clear-add-clear-add, resulting in the below behavior.

This can be reproduced by typing two or more keystrokes and then undo (ctrl/cmd + Z).

Example 1

https://jsonnet.org/

Screen.Recording.2025-09-02.at.8.04.15.PM.mov

Local fix

I confirmed adding synchronization fixes the behavior locally.

Screen.Recording.2025-09-02.at.8.08.57.PM.mov

Example 2

On https://jsonnet.org/

Screen.Recording.2025-09-02.at.8.12.12.PM.mov

Local fix

Screen.Recording.2025-09-02.at.8.12.43.PM.mov

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