Preserve template application_url during app creation#7225
Open
MitchLillie wants to merge 1 commit intomainfrom
Open
Preserve template application_url during app creation#7225MitchLillie wants to merge 1 commit intomainfrom
MitchLillie wants to merge 1 commit intomainfrom
Conversation
When `shopify app init` uses an extension-only template (e.g. shopify-app-template-extension-only), the template specifies `application_url = "https://extensions.shopifycdn.com"`. Previously this URL was discarded — createApp() always sent hardcoded placeholder URLs to the platform. The subsequent link() step then pulled the placeholder back from the remote, overwriting the local config. Thread template URLs through CreateAppOptions so the platform receives the correct URL at creation time. Falls back to existing defaults when no template URL is provided (backward compatible). Fixes shop/issues-admin-extensibility#2395 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
applicationUrlandredirectUrlsfrom template config throughCreateAppOptionsto both Partners and App Management platform clientsshopify app inituses an extension-only template, the template'sapplication_url(https://extensions.shopifycdn.com) is now sent to the platform at creation time instead of a hardcodedhttps://example.complaceholderFixes shop/issues-admin-extensibility#2395
What was happening
app initclones the extension-only template which hasapplication_url = "https://extensions.shopifycdn.com"loadConfigForAppCreation()reads the template TOML but discardsapplication_urlcreateApp()sends hardcodedhttps://example.comto the platformlink()deep-merges remote config over local — remote wins for scalars, soexample.comoverwrites the template URL in the local TOMLThis also affects
--reset:fetchAppRemoteConfiguration()returnsundefinedfor Partners-based apps, so the fallback usesremoteApp.applicationUrl— the creation-time value that deploy never updates. By fixing the creation-time URL,--resetalso returns the correct value.Changes
developer-platform-client.tsapplicationUrlandredirectUrlstoCreateAppOptionsinterfaceloader.tsloadConfigForAppCreation()now extractsapplication_urlandauth.redirect_urlsfrom template TOMLapp.tscreationDefaultOptions()includesapplicationUrlandredirectUrlsfor thelink()code pathpartners-client.tsgetAppVars()usesoptions.applicationUrl ?? defaultAppUrlwith??fallback; simplified from branching if/else to single returnapp-management-client.tscreateAppVars()usesoptions.applicationUrl ?? defaultAppUrlandoptions.redirectUrls ?? [defaultRedirectUrl]loader.test.tspartners-client.test.tsapp-management-client.test.tsTest plan
Automated:
Manual — extension-only template:
Manual — standard template (regression check):
🤖 Generated with Claude Code