We’ve had several hundred of our merchants randomly lose one of our required scopes (write_discounts) within the last week or so.
We use Shopify managed installs and have the write_discounts scope as a required scope in our TOML:
[access_scopes]
# Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes
scopes = "read_products,write_discounts,write_price_rules"
optional_scopes = ["read_customers"]
use_legacy_install_flow = false
We’ve been using managed installs for about a year now, with these scopes unchanged since migrating to that. But in the last week we had two merchants come in because the discount writing functionality in our app was not working anymore for them and we were getting errors on our backend saying they didn’t have the correct scope for those GraphQL APIs. They were using the functionality as recently as last week, so they did have the scopes then.
We looked at any other merchants who have logged in to our app for the last 6 months and we have about 250 other merchants in the same boat where they are just missing that specific scope. Theoretically, they shouldn’t have been able to even get into our app without approving.
So far, the only way we’ve been able to resolve the issue is to have the merchants uninstall and reinstall. Logging into the app isn’t sufficient to getting Shopify to kick off the approval of scopes. Since the managed installs control that process entirely, there seems to be two bugs:
- Why did these require scopes randomly go away for some of our merchants? (It was also only the write_discounts scope every time… the others were fine)
- Why isn’t logging into the app for these merchants asking them to reapprove the required scope if they don’t have it?
I didn’t want to share any customer specific details, but if any Shopifolk want to reach out to me for those details, I can happily share them if that’s helpful into looking into it.