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

Webhooks are not triggered in deployed App #873

Closed
FynnMenkIT opened this issue Oct 28, 2024 · 2 comments
Closed

Webhooks are not triggered in deployed App #873

FynnMenkIT opened this issue Oct 28, 2024 · 2 comments

Comments

@FynnMenkIT
Copy link

... Setup Information in the recent bug and the same setup as the author of #818

Actually I would like to reopen the issue #818 , because of us having the same problem for deployed apps and the recent mentioned bug.
The described and only the described way of @vincaslt is working.
(Which is a very specific way to setup a working development environment to be honest, but it is working to be fair)

OK, so riding on the back of my observation, I got it to work like this:

  1. npm run dev -- --reset
  2. uninstall the app if installed before
  3. install the app
  4. shopify app deploy in a new console window
  5. hooks are firing (until next start, then repeat the steps again if adding webhooks, or 1 & 4 if not).

Is there a better way that doesn't require juggling URLs?

Unfortunately this is only working when having a locale machine running.
We want to deploy our app and the webhooks are not getting triggered.

I was expecting this to be only a problem in the local environment.
In addition to this by configurate the webhooks via .toml, there is no way to see the webhooks anymore.
(it was possible with the previous integration via webhook registration hook ).
The only way to see the registered hooks are:

  1. Trigger them with a console.log or logger: { level: LogSeverity.Debug, httpRequests: true, },
  2. See them in the partner dashboard under the specific deployed app version -> configuration

For our deployed app, we can see them in the partner dashboard, but they are not triggered in the console.
Does anyone else has a problem with not being able to trigger the webhooks ?

@lizkenyon
Copy link
Contributor

Hi there 👋

I don't believe this is an issue with the Remix template.

I would encourage you to create a post in the .dev community forums. These are forwarded to the teams that own the product area.

@ccarlosm
Copy link

ccarlosm commented Nov 5, 2024

I’m not sure if this is the case, but I encountered a similar issue that caused me quite a few headaches initially:

When running npm run dev, the app’s URLs in the development environment get updated, which can cause the APP_UNINSTALLED webhook to fire with an outdated URL and fail in development environments.

To work around this and ensure APP_UNINSTALLED is delivered to the correct URL, you can delete the session information in your database. This will trigger the afterAuth hook on the next page reload, updating the URL and successfully delivering APP_UNINSTALLED to the correct endpoint.

In production, however, the app URL should remain constant, and the app should be run with npm run build instead of npm run dev (Shopify documentation), so this problem shouldn’t occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants