adobe-photoshop / spaces-design

Adobe Photoshop Design Space
http://adobe-photoshop.github.io/
Other
853 stars 74 forks source link

Unrecoverable error: collapsing group changes selection to uninitialized layer #3542

Closed iwehrman closed 8 years ago

iwehrman commented 8 years ago
  1. Open Vermilion.
  2. Expand all layers.
  3. Select only a leaf layer in the top-most artboard, e.g. "pad copy 4"
  4. Reload Design Space.
  5. Quickly option-click the icon of the top-most artboard to recursively collapse the artboard.

Result: unrecoverable error.

Hypothesis: upon collapsing the group, the selection is correctly changed to the top-most artboard, but that artboard has not yet been initialized. The action does initialize the newly selected layer, but not until after dispatching SET_GROUP_EXPANSION. That handler unsafely accesses uninitialized layer properties, which results in an error. But a) that's just my guess (the console error is inscrutable); and b) that doesn't explain why the error is unrecoverable.

iwehrman commented 8 years ago

Here's the initial action log:


fluxcontroller.js:835 Enqueuing action panel.updatePanelSizes; 0/0
fluxcontroller.js:841 Executing action panel.updatePanelSizes after waiting 3ms; 1/0
fluxcontroller.js:835 Enqueuing action panel.updatePanelSizes; 1/0
fluxcontroller.js:835 Enqueuing action panel.updatePanelSizes; 1/1
main.js:135 Main component mounted: 324ms
fluxcontroller.js:835 Enqueuing action ui.beforeStartup; 1/2
fluxcontroller.js:835 Enqueuing action documents.beforeStartup; 1/3
fluxcontroller.js:835 Enqueuing action policy.beforeStartup; 1/4
fluxcontroller.js:835 Enqueuing action search.beforeStartup; 1/5
fluxcontroller.js:841 Executing action search.beforeStartup after waiting 0ms; 2/5
fluxcontroller.js:835 Enqueuing action keyevents.beforeStartup; 2/5
fluxcontroller.js:841 Executing action keyevents.beforeStartup after waiting 0ms; 3/5
fluxcontroller.js:835 Enqueuing action libraries.beforeStartup; 3/5
fluxcontroller.js:841 Executing action libraries.beforeStartup after waiting 1ms; 4/5
fluxcontroller.js:835 Enqueuing action menu.beforeStartup; 4/5
fluxcontroller.js:841 Executing action menu.beforeStartup after waiting 1ms; 5/5
fluxcontroller.js:835 Enqueuing action guides.beforeStartup; 5/5
fluxcontroller.js:841 Executing action guides.beforeStartup after waiting 0ms; 6/5
fluxcontroller.js:835 Enqueuing action history.beforeStartup; 6/5
fluxcontroller.js:841 Executing action history.beforeStartup after waiting 1ms; 7/5
fluxcontroller.js:835 Enqueuing action layers.beforeStartup; 7/5
fluxcontroller.js:841 Executing action layers.beforeStartup after waiting 0ms; 8/5
fluxcontroller.js:835 Enqueuing action shortcuts.beforeStartup; 8/5
fluxcontroller.js:835 Enqueuing action tools.beforeStartup; 8/6
fluxcontroller.js:835 Enqueuing action transform.beforeStartup; 8/7
fluxcontroller.js:835 Enqueuing action type.beforeStartup; 8/8
fluxcontroller.js:835 Enqueuing action panel.beforeStartup; 8/9
fluxcontroller.js:851 Finished action search.beforeStartup in 70ms with RTT 70ms; 8/10
fluxcontroller.js:851 Finished action keyevents.beforeStartup in 69ms with RTT 69ms; 8/10
fluxcontroller.js:851 Finished action menu.beforeStartup in 64ms with RTT 65ms; 8/10
fluxcontroller.js:851 Finished action guides.beforeStartup in 64ms with RTT 64ms; 8/10
fluxcontroller.js:851 Finished action history.beforeStartup in 62ms with RTT 63ms; 8/10
fluxcontroller.js:851 Finished action layers.beforeStartup in 62ms with RTT 62ms; 8/10
fluxcontroller.js:841 Executing action shortcuts.beforeStartup after waiting 61ms; 8/9
fluxcontroller.js:841 Executing action transform.beforeStartup after waiting 62ms; 8/8
fluxcontroller.js:841 Executing action type.beforeStartup after waiting 63ms; 8/7
fluxcontroller.js:851 Finished action shortcuts.beforeStartup in 5ms with RTT 66ms; 5/7
fluxcontroller.js:851 Finished action transform.beforeStartup in 5ms with RTT 67ms; 5/7
fluxcontroller.js:851 Finished action type.beforeStartup in 3ms with RTT 66ms; 5/7
fluxcontroller.js:851 Finished action panel.updatePanelSizes in 120ms with RTT 123ms; 2/7
fluxcontroller.js:841 Executing action panel.updatePanelSizes after waiting 112ms; 2/6
fluxcontroller.js:851 Finished action libraries.beforeStartup in 350ms with RTT 351ms; 2/6
fluxcontroller.js:851 Finished action panel.updatePanelSizes in 329ms with RTT 441ms; 1/6
fluxcontroller.js:841 Executing action panel.updatePanelSizes after waiting 439ms; 1/5
fluxcontroller.js:851 Finished action panel.updatePanelSizes in 40ms with RTT 479ms; 1/5
fluxcontroller.js:841 Executing action ui.beforeStartup after waiting 454ms; 1/4
fluxcontroller.js:841 Executing action panel.beforeStartup after waiting 443ms; 2/3
fluxcontroller.js:851 Finished action panel.beforeStartup in 122ms with RTT 565ms; 2/3
fluxcontroller.js:851 Finished action ui.beforeStartup in 128ms with RTT 582ms; 1/3
fluxcontroller.js:841 Executing action documents.beforeStartup after waiting 582ms; 1/2
history.js:342 [History] Initializing history based on historyState event from ps. Object
history.js:195 [History] Initializing history with 2 states
fluxcontroller.js:835 Enqueuing action panel.updatePanelSizes; 1/2
fluxcontroller.js:851 Finished action documents.beforeStartup in 4046ms with RTT 4628ms; 1/3
fluxcontroller.js:841 Executing action policy.beforeStartup after waiting 4629ms; 1/2
fluxcontroller.js:851 Finished action policy.beforeStartup in 215ms with RTT 4844ms; 1/2
fluxcontroller.js:841 Executing action tools.beforeStartup after waiting 4831ms; 1/1
fluxcontroller.js:851 Finished action tools.beforeStartup in 1209ms with RTT 6040ms; 1/1
fluxcontroller.js:841 Executing action panel.updatePanelSizes after waiting 1440ms; 1/0
fluxcontroller.js:835 Enqueuing action ui.afterStartup; 1/0
fluxcontroller.js:835 Enqueuing action documents.afterStartup; 1/1
fluxcontroller.js:841 Executing action documents.afterStartup after waiting 0ms; 2/1
fluxcontroller.js:835 Enqueuing action export.afterStartup; 2/1
fluxcontroller.js:841 Executing action export.afterStartup after waiting 1ms; 3/1
fluxcontroller.js:835 Enqueuing action help.afterStartup; 3/1
fluxcontroller.js:835 Enqueuing action layers.afterStartup; 3/2
fluxcontroller.js:835 Enqueuing action application.afterStartup; 3/3
fluxcontroller.js:835 Enqueuing action menu.afterStartup; 3/4
fluxcontroller.js:835 Enqueuing action shortcuts.afterStartup; 3/5
fluxcontroller.js:835 Enqueuing action tools.afterStartup; 3/6
fluxcontroller.js:835 Enqueuing action type.afterStartup; 3/7
fluxcontroller.js:841 Executing action type.afterStartup after waiting 0ms; 4/7
fluxcontroller.js:835 Enqueuing action libraries.afterStartup; 4/7
main.js:130 Actions loaded: 6431ms
main.js:141 Startup complete: 6436ms
fluxcontroller.js:835 Enqueuing action tools.resetBorderPolicies; 4/8
fluxcontroller.js:851 Finished action type.afterStartup in 22ms with RTT 22ms; 4/9
fluxcontroller.js:851 Finished action documents.afterStartup in 33ms with RTT 33ms; 3/9
fluxcontroller.js:841 Executing action menu.afterStartup after waiting 27ms; 3/8
fluxcontroller.js:851 Finished action menu.afterStartup in 5ms with RTT 32ms; 3/8
fluxcontroller.js:841 Executing action shortcuts.afterStartup after waiting 33ms; 3/7
fluxcontroller.js:851 Finished action shortcuts.afterStartup in 4ms with RTT 37ms; 3/7
fluxcontroller.js:841 Executing action libraries.afterStartup after waiting 34ms; 3/6
fluxcontroller.js:851 Finished action libraries.afterStartup in 740ms with RTT 774ms; 3/6
fluxcontroller.js:851 Finished action panel.updatePanelSizes in 1217ms with RTT 2657ms; 2/6
fluxcontroller.js:841 Executing action ui.afterStartup after waiting 1199ms; 2/5
export.js:314 Export: Found configured port: 59596
fluxcontroller.js:851 Finished action ui.afterStartup in 1393ms with RTT 2592ms; 2/5
fluxcontroller.js:841 Executing action help.afterStartup after waiting 2587ms; 2/4
fluxcontroller.js:851 Finished action help.afterStartup in 2ms with RTT 2589ms; 2/4
fluxcontroller.js:841 Executing action layers.afterStartup after waiting 2589ms; 2/3
fluxcontroller.js:835 Enqueuing action groups.setGroupExpansion; 2/3
fluxcontroller.js:841 Executing action groups.setGroupExpansion after waiting 0ms; 3/3
export.js:937 Export: Generator plugin connection established
fluxcontroller.js:835 Enqueuing action export.setServiceAvailable; 3/3
fluxcontroller.js:841 Executing action export.setServiceAvailable after waiting 0ms; 4/3
fluxcontroller.js:851 Finished action export.setServiceAvailable in 5ms with RTT 5ms; 4/3
fluxcontroller.js:851 Finished action export.afterStartup in 2709ms with RTT 2710ms; 3/3
fluxcontroller.js:851 Finished action layers.afterStartup in 133ms with RTT 2722ms; 2/3
fluxcontroller.js:841 Executing action application.afterStartup after waiting 2723ms; 2/2

Here's the first stack trace:

Transfer from application.afterStartup to application.updateRecentFiles failed: SyntaxError: Invalid number
    at new NumberFormatter (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:25214:12)
    at exports.toFixed (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:25122:11)
    at _round (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:63314:22)
    at typed.number, number (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:63198:15)
    at Object.round (eval at _typed (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:24648:23), <anonymous>:42:16)
    at React.createClass._formatValue (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/spaces-design-en.js:34886:43)
    at React.createClass.componentWillReceiveProps (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/spaces-design-en.js:34805:34)
    at ReactCompositeComponentMixin.updateComponent (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:81493:15)
    at wrapper [as updateComponent] (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:75395:22)
    at ReactCompositeComponentMixin.receiveComponent (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:81440:11)
    at Object.ReactReconciler.receiveComponent (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:79623:23)
    at ReactCompositeComponentMixin._updateRenderedComponent (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:81597:24)
    at ReactCompositeComponentMixin._performComponentUpdate (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:81579:11)
    at ReactCompositeComponentMixin.updateComponent (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:81508:13)
    at wrapper [as updateComponent] (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:75395:22)
    at ReactCompositeComponentMixin.receiveComponent (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:81440:11)
    at Object.ReactReconciler.receiveComponent (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:79623:23)
    at Object.ReactChildReconciler.updateChildren (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:88451:26)
    at ReactDOMComponent.ReactMultiChild.Mixin._reconcilerUpdateChildren (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:88082:40)
    at ReactDOMComponent.ReactMultiChild.Mixin._updateChildren (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:88217:32)
    at ReactDOMComponent.ReactMultiChild.Mixin.updateChildren (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:88192:15)
    at ReactDOMComponent.Mixin._updateDOMChildren (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:85573:13)
From previous event:
    at Object.updateRecentFiles (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/spaces-design-en.js:67405:15)
    at null.<anonymous> (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/spaces-design-en.js:77772:45)
    at tryCatcher (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:5091:24)
    at Promise._settlePromiseFromHandler (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:3155:32)
    at Promise._settlePromise (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:3212:19)
    at Promise._settlePromiseCtx (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:3249:11)
    at file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:265:21
    at MutationObserver.<anonymous> (file:///Users/wehrman/Desktop/photoshop-Release_x86_64/Plug-Ins/Spaces/www/build/externalDeps.js:4389:14)
iwehrman commented 8 years ago

@chadrolfs: can you repro any errors at this point? @volfied wasn't able to, and I also check in a band-aid to the immediate (but not to the fundamental) problem. In any case, it was relatively hard for me to trigger, sometimes taking 3 or 4 tries. If nobody else can repro, then I'm willing to close this as hopefully harmless heisenbug.

chadrolfs commented 8 years ago

I CNR on mac and win with current master and jenkins 990m, 973w.