Skip to content

[Bug] Spam-clicking Run button causes Blocks.unhighlight undefined error #6010

@mishtia25708

Description

@mishtia25708

Description

Rapidly clicking the Run (red) button multiple times eventually causes a runtime error and crashes execution.

The application throws:

Uncaught TypeError: Cannot read properties of undefined (reading 'unhighlight')
at Blocks.unhighlight (blocks.js:2974)
at logo.js:1725

This appears to be caused by overlapping executions without proper highlight state cleanup when the Run button is spam-clicked quickly.

The application should not crash due to rapid user interaction.

Expected Behavior

The Run button should either:

Ignore clicks while execution is already in progress

Debounce rapid clicks

Or safely handle concurrent executions without breaking highlight state

Under no circumstances should rapid clicking result in a runtime error.

Steps to Reproduce

Start Music Blocks locally.

Add:

start

one note

one pitch block

Rapidly click the Run (red) button multiple times.

Observe the runtime error in the browser console.

Image

Environment

macOS

Node v18.20.8

npm v10.8.2

Latest master branch

Checklist

I have read and followed the project's code of conduct.

I have searched for similar issues before creating this one.

I have provided all the necessary information to understand and reproduce the issue.

I am willing to contribute to the resolution of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions