Repository navigation
Revert "fix: storage view is not reset when switching buckets" - #43539
Conversation
This reverts commit 9ce3bdf.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes refactor the storage explorer's state management by removing the Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/studio/state/storage-explorer.tsx (1)
1883-1908:⚠️ Potential issue | 🔴 CriticalReintroduces stale state when switching buckets.
This effect now only rebuilds the explorer store when the project changes, so bucket-scoped state (
openedFolders,columns,selectedBucket) survives bucket-to-bucket navigation inside the same project. Inapps/studio/components/interfaces/Storage/StorageExplorer/StorageExplorer.tsx,fetchContents()still runs beforeopenBucket(), which means the first fetch after navigating from something likebucket-a/folder-xtobucket-bcan still use the old bucket/path state and render bucket A’s contents under bucket B. Please keep resetting the explorer on bucket changes, or clear the bucket-scoped fields before any fetch for the new bucket starts.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/studio/state/storage-explorer.tsx` around lines 1883 - 1908, The effect in storage-explorer.tsx only rebuilds state when the project changes, allowing bucket-scoped state (openedFolders, columns, selectedBucket) to persist across bucket navigation and cause fetchContents() in StorageExplorer.tsx to render old bucket data; update the useEffect (or the logic that calls createStorageExplorerState) to also respond to bucket changes by clearing bucket-scoped fields: reset openedFolders, columns, and selectedBucket (or recreate the explorer state) whenever the active bucket changes (ensure the bucket identifier is included in the effect dependencies or trigger a state reset before fetchContents/openBucket runs) so the explorer cannot reuse stale bucket/path state during the first fetch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@apps/studio/state/storage-explorer.tsx`:
- Around line 1883-1908: The effect in storage-explorer.tsx only rebuilds state
when the project changes, allowing bucket-scoped state (openedFolders, columns,
selectedBucket) to persist across bucket navigation and cause fetchContents() in
StorageExplorer.tsx to render old bucket data; update the useEffect (or the
logic that calls createStorageExplorerState) to also respond to bucket changes
by clearing bucket-scoped fields: reset openedFolders, columns, and
selectedBucket (or recreate the explorer state) whenever the active bucket
changes (ensure the bucket identifier is included in the effect dependencies or
trigger a state reset before fetchContents/openBucket runs) so the explorer
cannot reuse stale bucket/path state during the first fetch.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 15ecf6c9-2a11-409c-a329-9753e16d9273
📒 Files selected for processing (3)
apps/studio/components/interfaces/Storage/StorageExplorer/StorageExplorer.tsxapps/studio/state/storage-explorer.tsxe2e/studio/features/storage.spec.ts
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › database.spec.ts › Database › Schema Visualizer › actions works as expected Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
Braintrust eval reportEvals in progress... ⌛ |
Reverts #43370