Skip to content

Fix site specification SDK package#3091

Merged
TorstenDittmann merged 6 commits into
mainfrom
fix-site-build-runtime-spec-limits
Jun 23, 2026
Merged

Fix site specification SDK package#3091
TorstenDittmann merged 6 commits into
mainfrom
fix-site-build-runtime-spec-limits

Conversation

@TorstenDittmann

@TorstenDittmann TorstenDittmann commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What

  • Updates @appwrite.io/console to the SDK artifact from 4851d03
  • Calls listSpecifications({ type: "builds" }) for build specification options
  • Calls listSpecifications({ type: "runtimes" }) for runtime specification options
  • Keeps build and runtime specification fallbacks separate for sites and functions
  • Removes reliance on enabledForBuilds; enabled now applies to the requested specification type
  • Syncs with latest main

Testing

  • bun run check
  • bun run lint

@appwrite

appwrite Bot commented Jun 22, 2026

Copy link
Copy Markdown

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Building Building View Logs Preview URL QR Code

Tip

Custom domains work with both CNAME for subdomains and NS records for apex domains

@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the @appwrite.io/console SDK to artifact 4851d03 and splits the single listSpecifications() call into separate { type: "builds" } and { type: "runtimes" } calls for both the functions and sites settings pages, removing reliance on enabledForBuilds and keeping the two spec types properly separated.

  • SDK bump & API split: Both the functions layout and sites settings page now make two parallel listSpecifications requests (one per type) and pass the results to downstream components as buildSpecs/runtimeSpecs props, replacing the old unified specs prop.
  • Sites guard improvement: sites/settings/+page.ts correctly adds a length && guard before overriding site.buildSpecification/runtimeSpecification, preventing a silent undefined override when the enabled-specs list is empty. The same guard is not present in the functions equivalent.
  • Fallback improvement in updateBuildSettings: The submit path now falls back to the current spec value (?? site.buildSpecification) instead of undefined when no enabled specs are available.

Confidence Score: 4/5

Mostly safe to merge, but the functions settings page can silently clear a function's build and runtime specifications to undefined on every page load when no enabled specs are returned.

The sites path received a length && guard before overwriting spec values, but the functions +page.ts (lines 24–29) still overwrites fn.buildSpecification and fn.runtimeSpecification unconditionally when the enabled-spec array is empty — which happens for all self-hosted users and transiently on cloud if the API returns an empty list. A user visiting the functions settings page on self-hosted would silently lose whatever specs were previously set.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/+page.ts — the spec-override logic at lines 24–29 needs the same length && guard that was added to the sites equivalent.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/functions/+layout.ts Splits the single listSpecifications call into separate build/runtime calls; aliases buildSpecificationsList back to specificationsList for backwards compat. Asymmetric guard logic in the child +page.ts (missing length check) means fn.buildSpecification can be silently set to undefined when enabled specs list is empty.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/+page.ts Separates build/runtime spec filtering but lacks the length && guard that was added to the sites equivalent — when enabledSpecs is empty, fn.buildSpecification and fn.runtimeSpecification are unconditionally set to undefined.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateResourceLimits.svelte Prop renamed from specs to buildSpecs/runtimeSpecs; separate option arrays generated correctly. Disabled guard uses total option count rather than enabled-only count, unlike the sites counterpart.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/+page.ts Correctly splits into two separate listSpecifications calls with length guards before overriding site.buildSpecification and site.runtimeSpecification.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte Prop split into buildSpecs/runtimeSpecs; framework-change and submit paths both updated to use separate enabled-spec lists. Fallback in submit now preserves the current spec value instead of passing undefined when no enabled specs exist.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateResourceLimits.svelte Correctly uses buildEnabledSpecs/runtimeEnabledSpecs for the disabled state, ensuring the whole selector is disabled rather than leaving an interactive select with all-disabled options.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/+page.svelte Prop names updated to buildSpecs/runtimeSpecs in both UpdateBuildSettings and UpdateResourceLimits call sites; no logic changes.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/+page.svelte Passes buildSpecs/runtimeSpecs props to UpdateResourceLimits; straightforward rename with no logic changes.
package.json Bumps @appwrite.io/console from 15.1.0 to a pkg.vc artifact URL pinned to commit 4851d03, consistent with how pink-icons-svelte is already versioned in this repo.

Reviews (5): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

…e-spec-limits

# Conflicts:
#	bun.lock
#	package.json
@TorstenDittmann TorstenDittmann merged commit f12239a into main Jun 23, 2026
2 of 4 checks passed
@TorstenDittmann TorstenDittmann deleted the fix-site-build-runtime-spec-limits branch June 23, 2026 12:33
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.

1 participant