Skip to content

shadow-block-converter throws exception on undo/redo #2573

@maribethb

Description

@maribethb

Check for duplicates

  • I have searched for similar issues before opening a new one.

Component

shadow-block-converter

Description

throws error when undoing. the actual UI state seems correct though. the error is because the shadow block doesn't exist in the workspace at the time the event is trying to look it up by id.

Reproduction steps

  1. Drag the "print example text 1/2" block.
  2. Modify the "example text 2" shadow block so it turns into a real block
  3. Ctrl z
  4. Note the error in the console
  5. Despite the error, undoing appears to work. But redo does not work.

The error is not thrown for the "reverse abc" block.

Stack trace

Uncaught Error: The associated block is undefined. Either pass a block to the constructor, or call fromJson
    at BlockChange$$module$build$src$core$events$events_block_change.run (events_block_change.ts:173:17)
    at WorkspaceSvg$$module$build$src$core$workspace_svg.undo (workspace.ts:735:15)
    at Object.callback (shortcut_items.ts:263:17)
    at ShortcutRegistry$$module$build$src$core$shortcut_registry.onKeyDown (shortcut_registry.ts:263:18)
    at onKeyDown$$module$build$src$core$inject (inject.ts:318:29)
    at HTMLDivElement.f (browser_events.ts:69:9)Understand this error

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions