fix: ship-blocker P1 — default shipping zone now covers US addresses (10001, 90210, etc) - #30
Merged
Merged
Conversation
…(10001, 90210, etc)
Root cause: The install hook created a default shipping zone with locations: [],
which matched NO addresses. matchesZone() returns false for any address when the
locations array is empty, causing all checkout attempts to fail with 'We don't
ship to that location yet.'
Changes:
- Updated ensureDefaultShippingZone() to create a proper US-wide zone with
locations: [{ country: 'US' }] that matches all US states
- Also creates a default flat-rate shipping method for the US zone
- Added comprehensive shipping zone matching tests (7 tests covering country-only,
region-specific, empty locations, multiple locations, order precedence, and the
specific P1 cases: NY 10001 and CA 90210)
All tests pass (92 tests total). Typecheck clean.
Starter/demo stores now ship to common US addresses out of the box.
Live demo needs redeploy after merge for the fix to take effect.
Co-authored-by: Timchosen Uzua <timchosen@gmail.com>
Co-authored-by: Timchosen Uzua <timchosen@gmail.com>
cavewebs
commented
Sep 15, 2026
cavewebs
left a comment
Contributor
Author
There was a problem hiding this comment.
Eng review (COMMENT)
Root cause looks real: empty locations: [] never matches in matchesZone — that explains the US zip FAIL. Tests on matchesZone/pickZone for 10001/90210 are the right acceptance shape.
CI: Typecheck + Build PASS; EmDash Compatibility (0.37.0) PASS.
Notes before mark-ready
- Live demo will not self-heal on redeploy alone —
ensureDefaultShippingZonestill early-returns when any zone exists, so the brokendefaultrow stays. Keep the SQL/admin remediation as a required post-merge step (PR body is clear; good). - SQL snippet targets
id = 'default'while new installs createus-domestic— correct for the live DB; call that out so nobody runs the wrong id after a wipe. SHIPPING_FIX_SUMMARY.mdat repo root — preferdocs/(or PR-only) so we don't ship a one-off ops memo at package root. Non-blocking if you want a tiny follow-up.- Install hook itself isn't unit-tested (only
matchesZone) — acceptable for this P1; optional later.
No code blockers for the install-hook change itself. Hold draft until Bot/Tim greenlight merge + demo remediation plan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ship-blocker P1 Fix: Checkout shipping zones
Fixes: Demo checkout rejects US ZIP codes 10001 (NY) and 90210 (CA) with "We don't ship to that location yet."
📋 Comprehensive fix documentation: See
SHIPPING_FIX_SUMMARY.mdfor detailed root cause analysis, verification steps, and live demo remediation options.Root Cause
The install hook created a default shipping zone with
locations: [](empty array), which matched NO addresses. ThematchesZone()function returnsfalsefor any address when the locations array is empty, causing all checkout attempts to fail.Changes
Updated
ensureDefaultShippingZone()inhooks/install.ts:locations: [{ country: 'US' }]that matches all US statesus-flat-rate) for the US zoneAdded comprehensive test coverage (
test/shipping-zones.test.ts):Verification
✅ All 92 tests pass (including 7 new shipping zone tests)
✅ Typecheck clean
✅ Build succeeds
To verify the fix:
US, NY, 10001→ ✅ matches zone, shows "Standard Shipping $5.00"US, CA, 90210→ ✅ matches zone, shows "Standard Shipping $5.00"Verification Demo
Live Demo Impact
The existing Railway/Neon deployment has the old broken zone. After merge:
Option 1: Redeploy (Recommended)
Option 2: Manual SQL Fix
Option 3: Admin UI (if shipping admin is deployed)
Benefits
Files Changed
packages/core/src/hooks/install.ts— UpdatedensureDefaultShippingZone()packages/core/test/shipping-zones.test.ts— New test file (7 tests)SHIPPING_FIX_SUMMARY.md— Comprehensive fix documentation