codesandbox / codesandbox/codesandbox-client

CRASH: Folder UI: SelectedItems Array not Cleaned Properly - Total Crash

Open
#6,480 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

💥 Crash Report

What were you trying to accomplish when the crash occurred?

Organize my Sandboxes
Crash Details
When organizing sandboxes in the "drafts" section once you move sandboxes the remaining list of items becomes a minefield. Clicking or right clicking will cause the page to crash [VIdeo of steps to reproduce](https://www.loom.com/share/0d21e30e82f0452da6a62fa8a74a0f38)

The issue is because the items that were previously moved become undefined in the selectedItemsarray that is passed to MultiMenu

Video to issue cause isolation

Environment
Browser Version Operating System CodeSandbox Version
chrome 98.0.4758 OS X 10.15.7 b32accec8

Route:
https://codesandbox.io/dashboard/drafts?workspace=b6a471b0-d79b-437d-8c15-c21444ad91f7

Error Code:
ac08f25831a247e598e57fc7fa2cbe3b

Error Message
TypeError: Cannot read properties of undefined (reading 'type')
TypeError: Cannot read properties of undefined (reading 'type')
  at https://codesandbox.io/static/js/app.2a9deefbf.js:266:292716
  at Array.filter (<anonymous>)
  at Im (https://codesandbox.io/static/js/app.2a9deefbf.js:266:292677)
  at ua (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1789558)
  at xs (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1834821)
  at ml (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1820397)
  at hl (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1820322)
  at il (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1817650)
  at https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1775833
  at t.unstable_runWithPriority (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1851169)
  at qo (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1775542)
  at Xo (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1775778)
  at Yo (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1775713)
  at se (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1844921)
  at Sn (https://codesandbox.io/static/js/common.eff6be823.chunk.js:1:1759339)

  in Im
  in Fm
  in qm
  in Fb
  in t
  in t
  in div
  in Content___StyledElement
  in Unknown
  in withRouter()
  in main
  in Dashboard___StyledElement2
  in div
  in Dashboard___StyledStack2
  in div
  in Dashboard___StyledStack
  in Unknown
  in De
  in Unknown
  in JC
  in t
  in t
  in div
  in elements__Content
  in n
  in withRouter(n)
  in div
  in elements__Container
  in Unknown
  in withRouter()
  in t
  in Unknown
  in De
  in c
  in t

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Folder UI in the drafts section and trace how the selectedItems array is passed to MultiMenu after sandboxes are moved. Reproduce the sequence from the linked video, then verify that clicking and right-clicking the remaining items no longer crashes with an undefined item.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.