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

[Bug]: app config:link brings extra slash from application_url into toml which causes app deploy to register relative webhooks with double slashes #4511

Closed
2 tasks done
muchisx opened this issue Sep 23, 2024 · 2 comments · Fixed by #4514
Labels
Type: Bug Something isn't working

Comments

@muchisx
Copy link

muchisx commented Sep 23, 2024

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

App

Expected behavior

When I run app deploy, and if t he webhook's uri is set correctly as per documentation, it shouldn't add extra slashes.

This is important for our workflow as we have different environments that are actually separate apps, so we often switch toml files for the same app, but deploys are risky due to this.

Actual behavior

When you have a set production (or dummy) url set in application_url such as:

#shopify.app.toml
application_url = "https://demo.com"

and then run again app config:link followed by an app deploy you will notice that it changes to

#shopify.app.toml
application_url = "https://demo.com/"

and that if you had configured any webhooks in the toml relatively, they will get double starting slashes such has:

#shopify.app.toml
  [[webhooks.subscriptions]]
  uri = "//webhooks/shop/redact"
  compliance_topics = [ "shop/redact" ]

Verbose output

which command should I run with verbose?

Reproduction steps

  1. Create a Remix app with npm init @shopify/app@latest
  2. Register the app in the partners via npm run dev, when it asks to automatically update urls, select No, never.
  3. Go to partners and set the application URL to https://demo.com and the redirection url to https://demo.com/api/auth.
  4. Pull back config with npm run config:link, selecting existing app.
  5. Run npm run deploy as the the template should already come with some pre-set webhooks in shopify.app.toml.
  6. Go to partners account and see the following:
    Image

This issue is not limited to the compliance webhooks, these are just the ones visible from the dashboard (btw, feature request to see all config-managed subscriptions from the dashboard 🙏🏻) All webhooks subscribed with the CLI end up having double slashes and failing deliveries!

Operating System

Windows 11

Shopify CLI version (check your project's package.json if you're not sure)

3.67.1

Shell

powershell

Node version (run node -v if you're not sure)

v20.11.1

What language and version are you using in your application?

Typescript

@gonzaloriestra
Copy link
Contributor

Hi! Thanks a lot for reporting the issue.

I think this is only happening with privacy compliance webhooks. Because we recently fixed the same issue for the regular ones, but I didn't realized that the privacy compliance webhooks are handled differently.

Regarding the visibility in Partners dashboard, you can actually check them in the Versions section:
Image

I'm working on a fix that should be released soon. In the meanwhile, this version should work correctly: npm i -g @shopify/[email protected].

@gonzaloriestra
Copy link
Contributor

It should be fixed in v3.67.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants