Open mironov opened 3 months ago
Hi @mironov
Thank you for reporting this issue. I'm able to reproduce the issue by uninstalling the app and and close the setting page.
We'll look more into this issue to figure out why the page doesn't navigate away after app uninstallation.
Si
Issue summary
Before opening this issue, I have:
shopify_api
version: 14.3.0log_level: :debug
in my configuration, if applicableI believe this has started after switching to the new token exchange API.
When user uninstalls our app, that executes a background job that destroys the shop record. Shortly after, a request to our web app comes with the token of that shop:
That results in the following error:
I believe it is happening on the following lines: https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/auth/token_exchange.rb#L53-L68
However, it is not handled because error is not
invalid_subject_token
butapp_not_installed
. The error bubbles up to our controller.If that is helpful, here is the id of the error: edf7bd5b-4f17-4bf8-a35e-0bba570eb2bd-1717860642.
Expected behavior
I think the error should be handled gracefully, and
InvalidJwtTokenError
should be bubbled up instead.Actual behavior
Error is not handled.
Steps to reproduce the problem
I can't reliably reproduce this but from the logs I see the same order of steps is happening.
Debug logs