-
Notifications
You must be signed in to change notification settings - Fork 144
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
Update create function cover for case where VCS is not enabled #544
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 don't think it makes sense to await the consoleVariables in the main layout.ts we can await them when we need them 👍
|
||
isDomainsEnabled = (await $consoleVariables)?._APP_DOMAIN_ENABLED === true; | ||
}); | ||
const isDomainsEnabled = $consoleVariables?._APP_DOMAIN_ENABLED === true; |
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.
$consoleVariables
might need to be awaited since we are not doing it in the layout
onMount(async () => { | ||
isAssistantEnabled = (await $consoleVariables)?._APP_ASSISTANT_ENABLED === true; | ||
}); | ||
const isAssistantEnabled = $consoleVariables?._APP_ASSISTANT_ENABLED === true; |
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 might need to be awaited too 🤔
src/routes/console/+layout.ts
Outdated
@@ -16,7 +16,7 @@ export const load: LayoutLoad = async ({ fetch, depends }) => { | |||
const data = await response.json(); | |||
|
|||
return { | |||
consoleVariables: sdk.forConsole.console.variables(), | |||
consoleVariables: await sdk.forConsole.console.variables(), |
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.
We didn't await it here to avoid a needless extra fetch request that might slow stuff down 😄
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'm not sure if it's worth it because:
- it complicates the rest of the code
- the variables are fetched 20ms after version even before this change
What could be useful is fetching both the version and the variables concurrently.
|
||
const functionId = $page.params.function; | ||
const isVcsEnabled = $consoleVariables?._APP_VCS_ENABLED === true; |
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.
await 👍
17ac61d
to
93a7323
Compare
await the data during load so it's available downstream without needing to await.
93a7323
to
d6def22
Compare
d6def22
to
a3bc3f8
Compare
What does this PR do?
Closes appwrite/appwrite#6180
Test Plan
Manual w/o VCS:
Manual w/ VCS:
Related PRs and Issues
Have you read the Contributing Guidelines on issues?
Yes