scratchfoundation / scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.
https://scratch.mit.edu/developers
Apache License 2.0
2.6k stars 1.39k forks source link

All-around breaking issues on Firefox, probably tied to workspace/palette reloading? #1969

Open towerofnix opened 5 years ago

towerofnix commented 5 years ago

Sorry for this mess of an issue/vague repro notes!

It's difficult to figure out exactly what the cause of any of these issues is, but they all have essentially the same effect: the Scratch page freezes up, becoming entirely unusable until I kill the tab ("a webpage is slowing down your browser, would you like to close it?" browser popup).

It's also not consistently reproducible. Messing around with the Scratch editor always causes it to freeze up eventually, but I can't always follow the same steps and have it crash at the same time.

Things that I've done right before the editor crashes:

  1. View the project page.
  2. Open the custom procedure dialog (click "make a block" or "edit definition").
  3. Switch between editor tabs or sprites.

Save for the first case (viewing the project page), it seems like it always happens when a workspace is reloaded. And/or maybe unloaded, which would account for exiting the editor?

I've also noticed that instead of freezing up, the block flyout will generate incorrectly with all the block SVGs positioned at the top-left of the flyout area, or the options in the context menus for variables in the flyout will stop working (something about e.blockList being undefined? -- mind I may be misremembering that, I've reloaded the tab and cleared the console since).

I'm using Firefox Developer Edition (69.0b7 / Linux) so it's not unreasonable to think there may be a bug in Firefox and not Scratch, but it's probably still worth investigating. I can't repro on Chromium. Edit: I can only repro this on dev edition, not Firefox ESR (60.7 / Linux, Mac).

This has been an issue for at least a couple weeks (on scratch.mit.edu) now. I can reproduce the same issues on llk.github.io, though (but again, not consistently).

towerofnix commented 5 years ago

A couple specific repro cases and error messages (testing on https://llk.github.io/scratch-gui/develop/):

(Expand, contains lengthy stack traces)
  1. Make a custom block.
  2. Make another custom block.
  3. Click "Make a Block" a third time. Browser freezes here.
  4. In the error log:
    TypeError: e.workspace is undefined
        BlockBase
        Change
        setInputsInline
        setInputsInline
        SHAPE_STATEMENT
        apply
        jsonInit
        init
        Block
        BlockSvg
        newBlock
    
  1. "Make a Block", then press Cancel. Repeat several times over.
  2. Eventually the block palette regenerates with all blocks at the origin (0, 0) (the page does not freeze up) and this error:
    TypeError: this.inputList is undefined
        appendInput_
        appendInput_
        appendDummyInput
        interpolate_
        jsonInit
        init
        Block
        BlockSvg
        newBlock
        newBlock
        domToBlockHeadless_
        domToBlockHeadless_
        domToBlock
        show
        showAll_
        refreshSelection
        refreshToolboxSelection_
    
  3. Switching to the Costumes tab and then back yields this weird layout issue: Several blocks positioned at the top-left of the palette, below the 'Motion' label and this error:
    NotFoundError: Node was not found
        createRect_
        layout_
        show
        showAll_
        populate_
        updateToolbox
        value
        toolboxUpdateTimeout
    
    4. Same weird layout and error when I switch to the costumes tab and back again, but switching to the stage the palette is fine and then switching back it's fine.
rachel-fenichel commented 5 years ago

Can you: 1) Head over to https://blockly-demo.appspot.com/static/tests/playground.html 2) Check the "log events" box 3) Play around with variables, functions, etc.

and let me know if you're seeing similar issues?

towerofnix commented 5 years ago

@rachel-fenichel Nothing similar happened there - it ran just as it's supposed to afaik.