Fix --reset flag regression: skip spurious TOML selection prompt before link flow#7238
Fix --reset flag regression: skip spurious TOML selection prompt before link flow#7238timothytenzin20 wants to merge 1 commit intomainfrom
Conversation
…re link flow When running `shopify app dev --reset`, `getAppConfigurationContext()` was called unconditionally before checking `forceRelink`. If the cached config file didn't exist on disk, this triggered `selectConfigFile()`, prompting the user to pick a TOML file that would be immediately discarded by `link()`. Regression introduced by #6612 ("Remove legacy app schema", commit 1f8dcce) which merged the forceRelink and !isLinked branches back together, undoing the prior fix from #5676. Fix: separate the two paths so forceRelink skips `getAppConfigurationContext()` entirely and calls `link()` directly. Fixes shop/issues-develop#22531
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260410122533Caution After installing, validate the version by running |
gonzaloriestra
left a comment
There was a problem hiding this comment.
Thanks for the PR! The fix makes sense, but I think something is not working. I'm still getting the config prompt when running pnpm shopify app info --reset after deleting the current TOML and having multiple ones.
I think what's missing is to avoid it from link. In 04-08-fix_reset_spurious_toml_selection_prompt_2 I added the missing pieces. Still have to review and test more, but it seems to work. Feel free to add here the changes from there if you want.
There was a problem hiding this comment.
This is for the users, I think it's too technical. I'd simplify it to something like Avoid config prompt when using --reset flag

Bug
shopify app dev --resetspuriously prompts TOML file selection before the reset flow (org → app → config name). The selected TOML is immediately discarded.Issue: shop/issues-develop#22531
Root Cause
Regression introduced by #6612 ("Remove legacy app schema", merged Mar 2026). Commit
1f8dcceaec("Simplify code") merged theforceRelinkand!isLinkedbranches back together, undoing a prior fix from #5676 (Apr 2025) which fixed #5653 by separating theforceRelinkpath so it skips config state loading.getAppConfigurationContext()is called unconditionally before checkingforceRelink. When the cached config file doesn't exist on disk, it callsselectConfigFile(), prompting the user to pick a TOML — even thoughforceRelinkwill discard the result.Fix
Separate the two paths so
forceRelinkskipsgetAppConfigurationContext()entirely and callslink()directly:Test
Added test verifying
getAppConfigurationContextis only called afterlink()whenforceRelinkis true (usinginvocationCallOrdertracking).All 12 tests pass ✅