Shopify / Shopify/shopify_app

How to handle a full browser reload

Open
#1,947 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.9k
Forks
739
Avg merge
21h 2m
Merged PRs (30d)
1

Description

Overview

What's the recommended way of handling the case where a user hits the "reload" button on their browser? When this happens the host param is missing (which is provided by Shopify when someone first navigates to the app) and then the call to createApp (from @shopify/app-bridge fails) with a complaint about host missing.

11:04:50.219 Uncaught (in promise) 
Object { name: "AppBridgeError", message: "APP::ERROR::INVALID_CONFIG: host must be provided", stack: "AppBridgeError@https://ga.jspm.io/npm:@shopify/app-bridge-core@1.0.1/actions/Error/index.js:1:1675\nfromAction@https://ga.jspm.io/npm:@shopify/app-bridge-core@1.0.1/actions/Error/index.js:1:1844\nvalidateAndDecodeConfig@https://ga.jspm.io/npm:@shopify/app-bridge@3.7.4/index.js:5:4112\ncreateClientApp$1/<@https://ga.jspm.io/npm:@shopify/app-bridge@3.7.4/index.js:5:2733\ncreateApp$1@https://ga.jspm.io/npm:@shopify/app-bridge@3.7.4/index.js:12:89\ninitShopifyApp@https://crowdfunder-octolabs.ngrok.io/assets/superliner/shopify_app-4337f031.js:187:16\ninitPage@https://crowdfunder-octolabs.ngrok.io/assets/superliner/shopify_app-4337f031.js:243:9\n@https://crowdfunder-octolabs.ngrok.io/assets/superliner/shopify_app-4337f031.js:258:3\n", action: undefined, type: "APP::ERROR::INVALID_CONFIG" }
shopify_app-4337f031.js:243:9

Possibly related to: https://github.com/Shopify/shopify_app/issues/1768

Possibly moot if a splash page really isn't needed anymore: https://github.com/Shopify/shopify_app/issues/1946

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the createApp call from @shopify/app-bridge and the initShopifyApp and initPage locations shown in the stack trace. Read the related issues 1768 and 1946 for context. Done means establishing and documenting the supported behavior for a full browser reload when the Shopify-provided host parameter is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.