-
Notifications
You must be signed in to change notification settings - Fork 5
fix: Querying data unreliable with custom backend #1577
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
base: master
Are you sure you want to change the base?
fix: Querying data unreliable with custom backend #1577
Conversation
da96890 to
e87c01c
Compare
maxy-shpfy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding "backendUrl" as part of query key seems to be not feasiable at scale.
Have you tried to invalidate ALL queries when we change backend settings?
See https://tanstack.com/query/v5/docs/framework/react/guides/query-invalidation
26c3495 to
b530eca
Compare
src/components/shared/ReactFlow/FlowCanvas/TaskNode/TaskOverview/logs.tsx
Show resolved
Hide resolved
b530eca to
033ffd3
Compare
This is a great point. Thank you. There are 4 local queries to (static YAML, IndexedDB, in-memory parsing). I have added backend flag to all queries that hit the backend, and adjusted the solution to invalidate all backend queries when backend settings change. |
033ffd3 to
2c3b459
Compare
|
Based on my analysis of the code, the old keys are in-memory and will be:
|
20b8dd5 to
ee33d9f
Compare
**Changes:** * Clear backend query cache when backend settings change * Wait until we have determined the backend url fully before executing backend queries
ee33d9f to
903f8b0
Compare
UpdateVerified that this fix supports: Local environments ✅
Remote environments ✅
|

Description
Added
BACKEND_QUERY_KEYto React Query hooks and updated query keys to ensure proper cache invalidation when the backend URL changes. This fixes issues where data wasn't being properly fetched when using a custom backend URL instead of the default one.The changes include:
backendUrlfrom query keys to ensure cache is shared regardless of URLBACKEND_QUERY_KEYprefix to backend-dependent queries!!configuredto query enabled conditions to prevent fetching before backend is configuredRelated issue
#1575
To Reproduce the bug on master
Before fix
After fix
Type of Change
Checklist
Test Instructions