Shopify / Shopify/shopify-api-ruby
Sorbet error when setting `host` config to `nil` in local development
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_apiversion:- Ruby version:
- Operating system:
- Set
log_level: :debugin 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
- If it is, please create a post in the Shopify community forums or report it to Shopify Partner Support
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
- Include FrameAncestor in one of your controller
- Set HOST env var as
www.example.comwithouthttporhttps
Debug logs
// Paste any relevant logs here
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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