Deeplinking of app blocks sometimes adds a wrong app block to the page

Hello,

We have noticed a glitch that sometimes when we are using deeplinking of app block previews it adds a wrong app block to the page, for example:

We have an app block for the product page and an app block for the collection page, the behavior when it works correctly is:

For the product page app block:

  1. we open our deeplinking url:

admin.shopify.com/store//themes/<theme_id>/editor?template=product&addAppBlockId=<app_block_id>/<block_name_for_product_app_block>&target=mainSection

  1. Shopify’s theme editor redirects to their link with more parameters and adds the app block to the page:

admin.shopify.com/store//themes/<theme_id>/editor?previewPath=%2Fproducts%2Fshirt&block=template–23332165648725__main__<app_block_of_product_page>&section=template–23332165648725__main

And for the collection page:

  1. we open our deeplinking url:

admin.shopify.com/store//themes/<theme_id>/editor?template=collection&addAppBlockId=<app_block_id>/<block_name_of_collection_app_block>&target=mainSection

  1. Shopify’s theme editor redirects to their link with more parameters and adds the app block to the page:

admin.shopify.com/store//themes/<theme_id>/editor?previewPath=%2Fcollections%2Fcategory&block=template–23332165648725__main__<app_block_for_collection_page>&section=template–23332165648725__main

But sometimes when we open the same link for product page app block, Shopify then keeps us on the right preview page which is the product page but instead of adding the product related app block it adds the collection one:

  1. we open our deeplinking url, same one that we use for the product page app block

  2. Shopify’s theme editor redirects to their link with more parameters and adds the app block to the page:

admin.shopify.com/store//themes/<theme_id>/editor?previewPath=%2Fproducts%2Fshirt&block=template–23332165648725__main__<app_block_for_collection_page>&section=template–23332165648725__main , here the previewPath is the right one, for products, but the app block is for the collection.

We assume it might be related to cache or frequent opening of theme editor pages in the browser, maybe having a few of them running together.

Is there anything to fix this behaviour?

Thanks in advance,
Vasya

7 Likes

Oh no, still no replies?

We recently encountered this weird issue too (we didn’t know about it until the BFS audit team pointed it out).

Our app has 6 blocks, and we use block 5 in our deep link. However, when users visit the deep link, some of them randomly see block 1 (which is the first alphabetically) being added instead. Sometimes it works correctly, sometimes not.

We tried renaming block 1 by adding a “w” to its name so it appears last, and then tested the deep link again. Surprisingly, a block from another app got added instead—what???

Then I created a brand new store with only our app installed. This time, the new “block 1” (since the old one became last alphabetically) was added via the deep link.

So I suspect the problem is related to the first block (alphabetically).

As a temporary workaround, we’re renaming the target block so it becomes the first in the list.
When will Shopify fix this? Only God knows.

Hi Shopify team,

Is there any update on this topic yet?

@Liam-Shopify can you please help to take a look on this issue?

In our case, I have multiple App Blocks and regardless of what I put as the handle in the deep link, it always adds the first App Block (alphabetic-wise) to the store.

Pretty sure this is a bug. Have tried multiple stores, browsers etc but to no avail. Please look into this.

We’re encountering an issue which I think is related:

  • we are deep linking using the {api_key}/{handle} URL
  • we have 3 environments each with its own app block: dev, staging and production
  • each environment has its own app with its own API key / client ID

However, what happens in practice is that the the staging block is added for dev, the production block is added for staging, and only for the production it’s actually the production one being added.

In the list, they’re one on top of each other - dev at the bottom, staging above it, production at the very top.

I’m pretty sure there’s an issue with the deep link. There must be a bug somewhere..

Hi @Shopify_Developer1,
We also encountered this issue recently. It seems that deeplink always gives a handle according to the app’s name
Is there anything to fix this behaviour?

Thanks in advance!

We experience the same issue. Would be great if this gets fixed