Shopify Admin link wrong parameters

priyankaD
New Member
2 0 0

Hi there,

 

I'm Priyanka and I'm Ruby on Rails developer at HulkApps.

 

We have built a Metafields application (Formally known as "Metafields Custom Fields Master") and have implemented Admin-links functionality http://prntscr.com/raq201 in the application.

 

While testing the functionality we found that sometimes the parameter passed in the redirection link is not accurate while sometimes no parameter is passed. I've recorded a video where you can find that when a merchant is accessing the Metafield Admin link from the Customer details page to edit the metafields, the user is redirected to another customer's 'edit metafield' page of our app.

 

The redirection functionality is executed on the basis of the object_id passed as a parameter in the response of the admin link.

 

Video link: https://www.loom.com/share/5a42831959394267809280c22d8b07f7

 

Can anyone please help us with this issue and help us identify why the wrong parameters are passed in the admin link response.

 

Thank you,

Replies 7 (7)
SBD_
Shopify Staff
1097 147 209

Hey Priyanka,

 

Thanks for reporting this. I'm able to replicate. The bug seems to appear with the use of the back button, a hard refresh resolves the issue.

 

Raising this internally. Keep you posted.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

priyankaD
New Member
2 0 0
Hey there,

Thank you so much for your insides. Please let me know once it is solved.

Thanks,
Priyanka Dabawala
SBD_
Shopify Staff
1097 147 209

This one appears to be resolved - let me know if you're still experiencing issues.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

policenauts
Trailblazer
191 9 49

@priyankaD @SBD_ I am also facing this issue a year later using product admin links where customers on rare occasions see the wrong data when trying to grab the query string using UrlParams. 

SBD_
Shopify Staff
1097 147 209

Thanks @policenauts - can you please DM replication steps?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

policenauts
Trailblazer
191 9 49

Hi @SBD_ thanks for getting back to me. This is difficult because I am unable to reproduce this on my end, but two app users have shown me videos where they are encountering something similar to the original poster here. In this case we are using Product Admin Links. One was using iOS and the other was using a laptop, so it was happening across devices. Both shops happened to be in Australia, but this could have been coincidence. 

The app grabs the URL query string parameters which are supposed to have the shop's information as well as the selected product ids[] in an array. However, it appears sometimes the wrong query string data is returned and thus when the request is then made to my app, it returns the wrong data for them. Here is the code I am using:

var queryString = window.location.search;
var urlParams = new URLSearchParams(window.location.search);

I changed var to const after this, but I don't believe that should have made a difference. Can you please forward this to the developers who work on Admin Links to see if they might have any idea what's going on? 

SBD_
Shopify Staff
1097 147 209

Thanks for the details @policenauts - any chance you're able to share one of the videos with me via DM?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog