Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

The SingleProject story sometimes failed to show workspace creation controls because of a race between two async operations:

  1. ProjectContext loads projects via api.projects.list()
  2. WorkspaceContext loads workspaces via api.workspace.list()

When WorkspaceContext.loading became false, App would render but projects might still be empty (size 0), causing the condition projects.size === 1 to be false, so creationProjectPath was null.

Fix: Add a loading state to ProjectContext and gate on it in AppLoaderInner alongside workspaceContext.loading.

Generated with mux

The SingleProject story sometimes failed to show workspace creation
controls because of a race between two async operations:

1. ProjectContext loads projects via api.projects.list()
2. WorkspaceContext loads workspaces via api.workspace.list()

When WorkspaceContext.loading became false, App would render but
projects might still be empty (size 0), causing the condition
`projects.size === 1` to be false, so creationProjectPath was null.

Fix: Add a loading state to ProjectContext and gate on it in
AppLoaderInner alongside workspaceContext.loading.

_Generated with `mux`_
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@ammario ammario merged commit ac179e5 into main Dec 7, 2025
19 checks passed
@ammario ammario deleted the storybook-workspace-render-race branch December 7, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants