Seeking clarification about `render-common`

We have a few embedded apps using AppBridge via CDN, and the shopify_app Ruby gem 23.0.3 (the latest as of today). It’s set up the recommended way according to the docs from shopify_app.

When a merchant accepts a subscription charge, Shopify redirects the merchant to the URL we defined.

There are several jumps that happen with that redirect to authenticate that request etc. The jumping and redirections are 100% handled by shopify_app, AppBridge and the Shopify Admin itself. We have not written any code for that whatsoever.

At the end of this jumping, it eventually lands on the page we want, but the problem I noticed is we always see 2 repeated requests:

  1. One is always canceled by render-common.js before the response can be rendered. This request contains hmac, token etc. It’s a valid request, so the app processes it normally.
  2. The second request has a different hmac, token etc. It’s also a valid request.

Anyway, I’m trying to understand, why does Shopify sends these 2 valid, authenticated requests, and why is one of them cancelled?

Hey @flavio-b, hope all’s well. I did some digging into this for you. The two requests appear to be separately generated Admin iframe navigations, with the cancelled request likely being replaced during re-embedding or refresh. Just trying to narrow down the cause.

Could you share:

  • A redacted HAR with Preserve log enabled
  • The exact returnUrl passed to appSubscriptionCreate
  • Whether /patch_shopify_id_token or shopify-reload appears between requests
  • Whether X-Shopify-Bounce and Authorization headers are present (values not needed)

I’d just redact HMACs, tokens, and shop/app identifiers. That should help us pinpoint where the second navigation originates on our side. Hope to hear from you soon.

Hello Alan,

Hope you’re doing well.

I was going to capture that information but this is very random. Sometimes we get the double render, sometimes not. I just canceled and started the subscription like 20 times across two apps. Sometimes we get the double render like 5 times in a row. Sometimes no double render 5 times in a row, etc.

I don’t know how we can debug something confidently with a HAR when the behaviour is this random.

What if I send you a link to the app, then you can initiate and cancel the subscription several times and capture the information in real time. You’ll see exactly what I see. We have an app that will allow you to do that with a partner or staff Shopify plan. Can you send me a new DM for this?