(Just filing an issue and instantly closing it, in order to document a strange behavior I encountered, because I've been stuck on this for almost 5 days without finding anything. I've been unlocked thanks to a question on partner discord).
Context
After
creating a new app with the template (on the API 6 branch, or any other derived branch)
deleting the app be it on the partner UI or with --reset,
I got stuck in a strange "loop" (that's not a redirect loop in the strict sense of it), like so :
The trouble
Running yarn dev
Clicking on the shareable link
The app flashing it's UX on a standalone page
The almost instantly redirecting to Shopify
(this is intended, to display the app in the iframe, this is not the root of the bug)
After this, instead of showing the app frontend, Shopify shows a screen saying
You don't have this app installed
Get App name and try again
[Install]
Clicking on "Install" will redirect twice and show the page again, leading to an infinite situation
The issue
This is due to the auth middleware thinking the app is installed; while it's not !
This line reports "true" for appInstalled, so never redirectToAuth (while it should); and later this line reports false; which causes the "install loop".
Why would appInstalled wrongly report true ?
Because the sqlite database still contains your old, previous-app-bound installation !
Resolution
Remove any .sqlite file from source code, and done
(Just filing an issue and instantly closing it, in order to document a strange behavior I encountered, because I've been stuck on this for almost 5 days without finding anything. I've been unlocked thanks to a question on partner discord).
Context
After
--reset
,I got stuck in a strange "loop" (that's not a redirect loop in the strict sense of it), like so :
The trouble
yarn dev
The issue
This is due to the auth middleware thinking the app is installed; while it's not ! This line reports "true" for
appInstalled
, so neverredirectToAuth
(while it should); and later this line reports false; which causes the "install loop".Why would
appInstalled
wrongly report true ? Because the sqlite database still contains your old, previous-app-bound installation !Resolution
.sqlite
file from source code, and done