Skip to content
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

[Themes][Fix] - Ensure that theme store is initialized in local storage when validating storefront password #4473

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

jamesmengo
Copy link
Contributor

@jamesmengo jamesmengo commented Sep 18, 2024

WHY are these changes introduced?

Fixes #4471

WHAT is this pull request doing?

This PR adds a call to ensureThemeStore() inside of the ensureValidPassword() method. This allows other packages to use ensureValidPassword() without explicitly calling ensureThemeStore(), and fixes a bug for users of the app dev command.

Background

All commands in the themes package call ensureThemeStore(), which sets and persists the value of the shop FQDN to local storage.

The app dev command does not call ensureThemeStore(), so if a user has never called a theme command, their system will be in a state where their local storage instance is not initialized. This is surfacing as an error here, where getThemeStore() returns undefined

How to test your changes?

Cursor.-.storefront-password-prompt.ts.cli.1.mp4

Post-release steps

  • Probably a back-port to 3.67

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-inner-loop

Copy link
Contributor

github-actions bot commented Sep 18, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 73% 8389/11491
🟡 Branches 69.56% 4091/5881
🟡 Functions 71.75% 2179/3037
🟡 Lines 73.35% 7938/10822
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / ConcurrentOutput.tsx
98.39% (-1.61% 🔻)
90.91% (-4.55% 🔻)
100%
98.33% (-1.67% 🔻)

Test suite run success

1889 tests passing in 857 suites.

Report generated by 🧪jest coverage report action from 53459a2

@jamesmengo jamesmengo marked this pull request as ready for review September 18, 2024 22:09
@jamesmengo jamesmengo requested review from a team, jantnovi and amcaplan and removed request for a team September 18, 2024 22:09
@jamesmengo jamesmengo self-assigned this Sep 18, 2024
@jamesmengo jamesmengo added Type: Bug Something isn't working #gsd:40767 Fortify local development experience for Liquid themes labels Sep 18, 2024
Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR, @jamesmengo. Excellent investigation!

I believe we could proceed with a following PR to update packages/cli-kit/src/public/node/output.ts and ensure we don't assume the presence of token. As a debug log, it's reasonable to coerce undefined values to strings to prevent similar errors in the future.

Thanks again for this PR and your thorough investigation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#gsd:40767 Fortify local development experience for Liquid themes Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Not able to run dev environment with CLI 3.67.0
3 participants