Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
…values Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d5d7a44 to
6f517d7
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.

Summary
Fixes shop/issues#8553 —
config2.map is not a functionrewriteConfigurationto short-circuit when config value is missingArray.isArrayguard in theZodArraybranch before calling.map()Root Cause
When
loadOpaqueApp(introduced in #6751) can't Zod-validate a local TOML config (e.g., a third-party template withoutclient_id), it falls back to raw, unvalidated TOML data. This raw data is deep-merged with the remote config and passed towriteAppConfigurationFile, whererewriteConfigurationwalks the Zod schema and assumes the config values match schema types. TheZodArraybranch calls.map()on the config value without checking if it's actually an array, crashing onnull,undefined, or type-mismatched values from the unvalidated data.Triggered by
app dev --reset(or any link flow) on apps using third-party templates.Why this fix
rewriteConfiguration's job is to reorder config keys to match schema structure — not to validate data. It should handle whatever data it receives gracefully, which is consistent with how it already passes through unknown schema types at the end of the function (return config). TheloadOpaqueAppraw TOML fallback is a legitimate feature for supporting third-party templates with config keys the CLI doesn't understand, so the defensive guard is the right layer for this fix.Test plan
rewriteConfigurationcovering null, undefined, and non-array config valueswriteAppConfigurationFiletests still passshopify app initwith a template that lacksclient_id, thenshopify app dev --reset— should no longer crash🤖 Generated with Claude Code