WIP: Fix remote-only configuration specs rejected as unsupported TOML sections#7399
Open
WIP: Fix remote-only configuration specs rejected as unsupported TOML sections#7399
Conversation
shopeter
approved these changes
Apr 24, 2026
Contributor
shopeter
left a comment
There was a problem hiding this comment.
🎩 'd locally and it worked! TY!
b8361fc to
5026b9e
Compare
5026b9e to
b4d412c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported in: https://shopify.slack.com/archives/C07UJ7UNMTK/p1777047053015119
What
Fixes a bug where remote-only configuration specs (like
purchase_options) with JSON schema contracts were incorrectly rejected withUnsupported section(s) in app configurationwhen present inshopify.app.toml.Three changes across the config parsing pipeline:
json-schema.ts— When validating a configuration spec instripmode, the parser now scopes the data to the TOML section contents before running JSON schema validation, instead of passing the entire app config.specification.ts—contributeToAppConfigurationSchemanow handles contract-based config specs (where the schema iszod.any()) by contributing the spec identifier as a known top-level key.loader.ts— The loader now claims the spec identifier as a used key when it exists in the app configuration, as a safety net for contract-based specs whose parsed result keys don't include the section name.Why
Remote-only configuration specs (specs returned by the server with
experience: 'configuration'but no local definition) are created withzod.any()as their schema. This caused a data scoping mismatch during TOML validation:zod.any()passes the entire app config through to JSON schema validation.{bundles: boolean}forpurchase_options), not the whole config.client_id,name,webhooks,purchase_options, etc.) match the section's properties (bundles).{}— empty. No extension instance is created, no keys are claimed, and the TOML section is flagged as "unsupported".This was proven empirically with debug logging on the unfixed code:
The fix scopes validation to the section contents (
{bundles: true}) rather than the whole config, and ensures the section key is properly claimed.Testing instructions
To reproduce the original bug and verify the fix end-to-end:
Set up: Make sure you have a Shopify app with a
shopify.app.tomlthat includes a[purchase_options]section (or any other remote-only configuration spec section):Run from this branch: The CLI monorepo uses
pnpmas its package manager. From the repo root, you can run CLI commands against an app directory using:dev cd cli gt get dev up pnpm shopify app deploy --path /path/to/your/appThis will build the CLI from source (via
nx build cli) and then run the command. The first run takes ~30s for the build; subsequent runs are faster if cached.You can also use
pnpm shopify app dev --path /path/to/your/appto verify the section is accepted during development mode.Expected results:
Unsupported section(s) in app configuration: purchase_options.deploy, it completes successfully (assuming valid app credentials and--allow-updatesif running non-interactively).Test coverage
json-schema.test.ts— 3 new tests: section scoping when identifier matches, no scoping when absent, validation errors propagated when scoped.specification.integration.test.ts— 3 new tests:contributeToAppConfigurationSchemafor contract-based config specs, extension specs (no contribution), and locally-defined config specs.loader.test.ts— 1 new test: end-to-end loading a TOML with a contract-based config section verifying no "unsupported section" error.