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

[Theme] Avoid process exit when failing to delete a file from the remote theme #4581

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

frandiox
Copy link
Contributor

@frandiox frandiox commented Oct 4, 2024

WHY are these changes introduced?

I found that this promise rejection was causing process exit:
image

Turning it here into an error message instead:

image

(Note in the above image I was using renderWarning but I've changed it to renderError since that's more accurate, I think)

WHAT is this pull request doing?

How to test your changes?

Post-release steps

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

@frandiox frandiox requested a review from a team October 4, 2024 06:22
Copy link
Contributor

github-actions bot commented Oct 4, 2024

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 Oct 4, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.61% (+0.01% 🔼)
8522/11737
🟡 Branches
69.54% (+0.02% 🔼)
4178/6008
🟡 Functions 71.61% 2205/3079
🟡 Lines
72.92% (+0.01% 🔼)
8064/11058

Test suite run success

1939 tests passing in 873 suites.

Report generated by 🧪jest coverage report action from df7b178

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, @frandiox!

I notice that it works as expected during startup, however, when the server is already running and users remove the templates/gift_card.liquid, they don't get the error message.

I don't consider that a blocker to merge tho, because the goal of this fix is to prevent the process from unexpectedly terminating, but I believe it would be nice if we could show the message in that context as well.

Thanks again for this PR!

@jamesmengo
Copy link
Contributor

jamesmengo commented Oct 4, 2024

🥳 This improves the output for theme push as well! Thank you!

image

We may be able to improve this even further in a followup issue by doing something like this by adding the delete results to the returned Results in the push command. I have a prototype here. Let me know your thoughts!

image

@frandiox frandiox added the #gsd:40767 Fortify local development experience for Liquid themes label Oct 7, 2024
@frandiox frandiox added this pull request to the merge queue Oct 7, 2024
Merged via the queue into main with commit dfa019f Oct 7, 2024
37 checks passed
@frandiox frandiox deleted the fd-delete-warning branch October 7, 2024 03:24
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants