-
Notifications
You must be signed in to change notification settings - Fork 293
Reuse preview store sessions in every theme command #8546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
+103
−19
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@shopify/theme': patch | ||
| --- | ||
|
|
||
| Fix theme commands on preview stores requiring login. Every theme command reuses a stored preview store session again, not only `theme pull` and `theme push`. |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth thinking about what this does to a stale preview session, the one from a store that's since been claimed. Before this PR it broke
theme pullandtheme push. After it, every theme command.There's no way for a user to clear it.
shopify auth logoutis justsessionStore.remove()(packages/cli-kit/src/public/node/session.ts:327) and never touches theshopify-cli-storestorage, and there's nostore auth logout. The only clear that exists today is the side effect inshopify store info(packages/store/src/cli/services/store/info/index.ts:166), which fires on a 401/404 from the preview-store API. Nobody is going to find that.That's the failure mode #8183's commit message called out, 401s that can't be fixed with
auth logout. #8390 is one answer, but the concern raised in the thread about clear-on-401 being unrecoverable for an unclaimed store still stands. Ashopify store auth logout --store <store>would cover it without that risk.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deferring this from #8546. #8390 already clears the stored preview session on a 401 and points to
store auth, so it covers the main path. Two notes: (1) #8390 is still a draft, so landing order matters — if #8546 lands first there is a window with no manual clear; (2) the residual concern stands: clear-on-401 is unrecoverable for an unclaimed store, andstore auth logout --storewould cover it without that risk. Keeping both as follow-ups.