Open kaarelss opened 1 year ago
Hi @kaarelss! Thank you for this extremely detailed bug report, it's a huge help.
This issue is actually even deeper than what you mentioned. Anytime an app is loaded via the apiKey (which is exactly what's happening after you redirect back from the recurring charge page), when a user clicks on a navigation item, the iframe will do a full reload. As you correctly noticed, this is because the navigation menu is using only the app handle in its links, whereas the app is capable of being loaded via either api key or app handle.
This is a known issue, and we are actively prioritizing a fix. That fix will involve only ever loading apps via their app handle (and redirecting if they try to use the api key). This issue should be fixed by that work. We'll keep you updated here with any progress.
Hi @MitchLillie. Thank you and your team for looking into this.
By the way - we started to receive additional client complaints that the side-menu does not change any iframe page - basically this what is visible in this video: https://youtu.be/Ff6TffJVYbo So it looks like it's happening more for others as well.
The Merchant browser is: Chrome, Version 106.0.5249.119 (Official Build) (x86_64)
@marisveide Yes--that's a separate but known issue, a fix for which should be in ASAP
Describe the bug
App bridge does page reload when using any path from
NavigationMenu
component after app charge is confirmed and redirected back to app.To Reproduce
Steps to reproduce the behaviour:
Create new rails controller
charge_controller.rb
end
... get "/api/charge/create", to: "charge#create" ...
import { Redirect } from '@shopify/app-bridge/actions'; import { TitleBar, useAppBridge } from '@shopify/app-bridge-react'; import { NavLink } from 'react-router-dom'; import { useAuthenticatedFetch } from '../hooks/index.js'; ... export default function HomePage() { const app_bridge = useAppBridge(); const redirect = Redirect.create(app_bridge); const fetch = useAuthenticatedFetch();
const handleCharge = async () => { const response = await fetch("/api/charge/create"); const response_json = await response.json();
}
return (