-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate requests to /api/card from Query Builder #31905
Comments
The first call is a little hard to track where it originates from but the second request is from here. metabase/frontend/src/metabase/query_builder/actions/core/initializeQB.ts Lines 107 to 112 in e7363d9
In
It'd be quite complicated to make sure this second request doesn't fire. I could think of one of the possible fix:
I however don't think this is worth pursuing since there would be no visible change to users and the fix would be quite complicated + need more discussion on the exact number we want to delay before actually firing a new request. I don't think it's worth all the effort at the end of the day. |
The first call comes from MainNavbar component. We need it to select an active collection in the left menu.
There we navigate to home page, then search some stuff in search box. Search api call loads metadata about a model, however this data does not contain the full entity data needed to display a model. Because of that we cannot just remove So, it seems, we should make this cache smarter to understand in which cases we have partial data in state. The logic for the first api request has been added here - https://github.com/metabase/metabase/pull/28057/files#diff-a6742c995fe25a651bfe9c2bf58296681d8440cc022c9569d338150364fdfb88R135 , it is a deliberate change. Also, in my first naive attempt to fix the issue, @ranquild mentioned that we should not create implicit logical dependecy between the left nav menu and main content area - #33898 (review). In the end, we cannot just remove either of api calls, and the second one has |
Describe the bug
Regression between 45 and 46.
The query builder makes 2 identical request to GET
/api/card/{id}
on load.To Reproduce
Expected behavior
1 request to GET
/api/card/{id}
Information about your Metabase installation
Severity
not user visible, an under-the-hood performance issue
Additional context
No response
The text was updated successfully, but these errors were encountered: