Shopify / Shopify/shopify-api-ruby

Sorbet error when setting `host` config to `nil` in local development

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

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.1k
Forks
484
PR merge metrics
No merged PRs in 30d

Description

Issue summary

Before opening this issue, I have:

  • Upgraded to the latest version of the package
    • shopify_api version:
    • Ruby version:
    • Operating system:
  • Set log_level: :debug in my configuration, if applicable
  • Found a reliable way to reproduce the problem that indicates it's a problem with the package
  • Looked for similar issues in this repository
  • Checked that this isn't an issue with a Shopify API

The gem raising on local dev with a passed nil into T.must?
When the HOST env var is set where the gem reads, but that env var doesn't contain a protocol, so the gem raises here. For us it's failing on this concern from shopify_app . We can hack around it for now by explicitly setting the host , but it looks like either the gem needs to be updated to support local dev, or dev needs to be updated to include a protocol in the HOST env var?

Expected behavior

host config works without requiring protocol scheme. Maybe setting a default?

Actual behavior

The gem raising on local dev with a passed nil into T.must?

Steps to reproduce the problem

  1. Include FrameAncestor in one of your controller
  2. Set HOST env var as www.example.com without http or https

Debug logs

// Paste any relevant logs here

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 in lib/shopify_api/context.rb at the HOST handling around lines 62 and 177, then inspect the linked shopify_app FrameAncestor concern to follow how the value is used. Reproduce with HOST set to www.example.com without a protocol; done means the host configuration works without requiring a protocol scheme, with the intended behavior confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.