Cannot debug shopify functions anymore in new version

Debugging Shopify functions is impossible now, because it shows missing “read_customers” scopes, even though the function has no PII.

If creating payment customizations need “read_customers” permissions to read fields, there shouldn’t even need to be a separate permission in the first place.

This will also have an impact on merchants, since now even more apps with poor security will ask for “read_customer” scopes.

Not even in error logs you can get useful information anymore.

I refuse to believe there are apps with 1000+ reviews on Shopify that are legit, when there’s 0 reaction from any people from these apps when an issue this critical arises.

Hey David!

The access scope requirement are based on what your input query is requesting.

Payment customizations could request customer information via cart { buyerIdentity { customer.

Is your function selecting any fields on the Customer type?

Yes, but it has no PII, if using these fields should require these permissions, there shouldn’t even be a “write_payment_customizations” permission.

The most critical part is that this is a recent unnanounced change, and now even error logs are renderered useless.

write_payment_customizations is the scope tied to the actual PaymentCustomization, which is what allows you to manage the customization tied to your function.

customers is the scope tied to the Customer. This is similar to Customer object in the Admin API, which requires read_customers. This is the only scope you’re missing for this function based off your screenshots. Once your app is updated to have the missing scope (and the merchant grants the new permissions), you’ll be able to see logs automatically.

Fields that contain PII (such as name/email) are considered protected customer data, and actually have an additional set of scopes. If you aren’t querying for those fields, then you won’t need these additional scopes.

You can read more about when we introduced this change in the developer changelog post. I want to be clear that these scopes are strictly for log visibility. Even without the required scopes, your functions are still executing as they were before.

Between the date the announcement and yesterday, you could just see all logs without the user having to do any action.

This means the update yesterday made the new “feature” become a regression, because while in the past the user had to click a “share logs” button, now he has to:

  • Install an app that has optional “read_customers” scopes (assuming the app developer is responsible and didn’t make it a required permission)
  • Click a button somewhere inside the app that shows a prompt saying the app will be able to “read_customers”
  • In case he is not using a feature that requires “read_customers” permission, assume the app developer won’t use the permission maliciously.

This is just more work for users, who in my experience will just give up on the app most of the time, in case they need help debugging their settings.

Also bigger scale stores usually try to protect user data and won’t grant such permissions that easily.

You could just apply the same logic to the “read_reports” permission, just make the entire shopifyQl query fail if the app doesn’t have any of the 30 permissions (This is just an analogy to illustrate how unreasonable the new update it, please don’t do this).