codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
12.96k stars 2.26k forks source link

fix: cache sidebar data per workspace to avoid slower requests overriding the state #8383

Closed alexnm closed 3 months ago

alexnm commented 3 months ago

Noticed in production that the sidebar data request can be slow when you have a lot of repositories. When switching between workspaces while the sidebar data is still loading, you can get the responses in random order so the state would be overriden.

With this solution, each sidebar data is kept in a record indexed on the workspace id

codesandbox[bot] commented 3 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview