-
Notifications
You must be signed in to change notification settings - Fork 159
fix: canvas to project navigation #8559
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: main
Are you sure you want to change the base?
Conversation
| runtime: runtimeData, | ||
| } = await fetchProjectDeploymentDetails(organization, project, token); | ||
|
|
||
| await runtime.setRuntime( |
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.
This will cause issues in other places that make a call to runtime in loader function. We should either replace all instances of such calls or keep this and revert back to how things worked before #8391
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.
That's the main point of this PR. There shouldn't be any calls/subscriptions to the runtime store in the loader functions. I just checked and really only found a call to openQuery, which I've refactored slightly. Please let me know if there are any others you're aware of. #8391 did not change anything meaningfully related to this behavior, it simply exposed that there was an underlying issue.
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.
I updated a few more routes. Also fixed openQuery, it was passing jwt and host.
|
@ericpgreen2 Added guards to the relevant queries so that they're not enabled if The types here are lacking since it's very much possible (depending on what route you're on) that instanceId is undefined. Usually components that require an instanceId shouldn't be rendered when it is undefined, but this is not true of |
Changed a few things myself. Will leave it up to @ericpgreen2 to approve

Canvas entity access is currently guarded by the
CanvasInitializationcomponent that retrieves existing canvas entities in the registry and creates new ones if necessary. Canvas entities are keyed on a combination of the canvas name and instanceId.However, after the initial application load, calls to
setRuntimein load functions trigger updates to the runtime store before the rest of the load andCanvasInitializationfunctions can run again. As such, when navigating from a canvas to a different project, the instanceId will change prior to the components being unmounted, causing them to attempt to access a new canvas keyed on a instanceId/name combination that doesn't exist.This PR attempts to fix that issue by removing calls to
setRuntimewithin the load functions. This may cause issues when trying to fetch data in load functions if accessing the runtime data from the store rather than the parent load function data. As mentioned in #8534, this sequence requires a thoughtful overhaul.Adds test to ensure navigation is possible.
Checklist: