Skip to content

fix: gate documentsdb/vectorsdb list calls behind multi-db flag#2991

Merged
premtsd-code merged 1 commit intomainfrom
feat-documentsdb
Apr 22, 2026
Merged

fix: gate documentsdb/vectorsdb list calls behind multi-db flag#2991
premtsd-code merged 1 commit intomainfrom
feat-documentsdb

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

Summary

The useDatabaseSdk().list() helper was unconditionally calling all three backends in parallel (tablesDB, documentsDB, vectorsDB), causing 404s on environments where the documentsdb/vectorsdb routes aren't exposed (e.g. staging/production with isDevelopment() gate) even when the multi-db feature flag is off.

Fix

Gate the documentsdb/vectorsdb list calls behind flags.multiDb. When the flag is off, only tablesDB.list() is called.

Test plan

  • With PUBLIC_CONSOLE_FEATURE_FLAGS= (empty): only /v1/tablesdb is called from the databases page
  • With PUBLIC_CONSOLE_FEATURE_FLAGS=multi-db: all three endpoints are called as before
  • User/org prefs for flags-multi-db also enable all three

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR fixes spurious 404 errors on environments where documentsdb/vectorsdb routes are not exposed by gating their list() calls behind the existing flags.multiDb check. When multi-db is off, only tablesDB.list() is called; all three are called in parallel as before when the flag is on. The change is minimal and correct — isFlagEnabled uses optional chaining so get(user)/get(organization) being unset is handled safely.

Confidence Score: 5/5

Safe to merge — targeted one-method change with no regressions on the existing code paths.

The fix is well-scoped, the logic is correct, and isFlagEnabled already handles null stores safely via optional chaining. All remaining observations are P2 or below.

No files require special attention.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/helpers/sdk.ts Adds flags.multiDb guard to list() so documentsDB/vectorsDB endpoints are only called when the feature flag is on; no other methods changed.

Reviews (1): Last reviewed commit: "fix: gate documentsdb/vectorsdb list cal..." | Re-trigger Greptile

@premtsd-code premtsd-code merged commit fb8d7a7 into main Apr 22, 2026
8 of 9 checks passed
@premtsd-code premtsd-code deleted the feat-documentsdb branch April 22, 2026 11:22
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