Skip to content

fix(sdk): bump submodule for CORS User-Agent fix - #342

Merged
thinkclay merged 1 commit into
mainfrom
fix/cors-user-agent-pointer-bump
Jun 11, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/cors-user-agent-pointer-bump

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Summary

Picks up Scaffald/sdk#7 — the SDK now sends X-Client-Info instead of User-Agent.

Live app.scaffald.com magic-link was still broken after #341 merged because the SDK was setting User-Agent: scaffald-sdk-js/0.1.0, which:

  • Browsers either strip silently (Chrome) or send and trip preflight (Safari)
  • Supabase Kong rejects with Request header field User-Agent is not allowed by Access-Control-Allow-Headers

Kong's Access-Control-Allow-Headers is authorization, x-client-info, apikey, content-type, x-trpc-source. X-Client-Info is the Supabase convention and is allowed by default.

Changes

Test plan

  • Local prepush validation passes (typecheck + tests)
  • Rebuild prod web bundle, redeploy
  • Magic-link from app.scaffald.com/auth/login — confirm POST to auth.scaffald.com/functions/v1/api/v1/auth/magic-link succeeds, magic-link email arrives

🤖 Generated with Claude Code

Picks up Scaffald/sdk#7. The previous SDK release (#6) unblocked the
apikey-header check at Kong, but exposed a second CORS-preflight failure:
the SDK was sending `User-Agent: scaffald-sdk-js/0.1.0`, which is a
forbidden request header in browsers and isn't in Kong's
`Access-Control-Allow-Headers` list. Browsers (esp. Safari) rejected
the preflight with:

    Request header field User-Agent is not allowed by
    Access-Control-Allow-Headers

The SDK now sends `X-Client-Info` instead, which Kong allows by default.

Also bumps scaffald-app patch version to 1.10.1.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@thinkclay
thinkclay merged commit 8d72dae into main Jun 11, 2026
6 of 9 checks passed
@thinkclay
thinkclay deleted the fix/cors-user-agent-pointer-bump branch June 11, 2026 07:42
thinkclay added a commit that referenced this pull request Sep 15, 2026
…rew, and iPads got two layouts at once (#769)

Closes #373 — the iPad audit that was filed as low priority and turned out to
hold a P0.

The native map has never rendered. mapboxStyleConfig.ts set the light style
to mapbox://styles/mapbox/standard in fe152b1 (2026-03-13) and the dark
style to a Scaffald style that imports it. Both need Mapbox Maps SDK v11;
the app bundles MapboxMaps 10.19.5 (@rnmapbox/maps 10.1.45). On v10 the
style request answers 200 — the token is fine, which is why #686/#694 could
not have caught this — and the SDK paints nothing: a black map with markers
floating on it. git tag --contains fe152b1 is every tag from app-v1.0.1
through app-v1.17.1, the build on TestFlight now. Proven by swapping in
streets-v12 alone and watching the same screen render. Native now reads
NATIVE_MAP_STYLE_CONFIG (streets-v12 / dark-v11); web keeps Standard, which
mapbox-gl JS v3 draws. The SDK v11 move that lets native have Standard too
is #765.

Every Office table threw "Text strings must be rendered within a <Text>
component" on native. columnsFromTanStack() hands flexRender()'s result to
@scaffald/ui's Table, which drops render() output straight into a <View>;
flexRender returns the raw value for any column without a custom cell. Web
tolerates a bare string there, native does not. Primitives now get a <Text>.

A 1032pt iPad Pro rendered the drawer's sidebar layout (width < 1024) and
the map screen's phone layout (isSmallScreen = width <= 800 || isNativeMobile)
at the same time, so the floating Map/List bar sat clipped over a
desktop-width map. Phones are under 800 on every platform, so the native
override only ever changed the answer for tablets, and changed it the wrong
way. Width alone now.

ui-sweep.mjs takes AUDIT_DEVICE (iphone | ipad-portrait | ipad-landscape |
android) so #373's viewports and #372's web half are one command each; its
login no longer clicks a terms checkbox the form has not had since #342; and
it dismisses the dev error overlay the #681 hydration mismatch paints over
every protected route at these widths. Three sweeps ran clean on --no-dev:
121 captures, 0 errors, no tablet-only layout break on web (768 gets the
phone layout, 1024 gets the sidebar).

Verified on the iPad Pro 13" simulator with an SDK 56 dev client built from
this tree: map renders, Office loads without the error, sidebar + desktop map
layout. Findings that need a decision rather than a fix are filed: #764
(native shows the web cookie banner), #765 (SDK v11). Two gotchas hit on the
way and worth knowing: Metro OOMs when a native lazy route bundles during a
web SSR sweep (#680) — keep the simulator idle while sweeping — and the
preview launcher reads the main checkout's .claude/launch.json, not the
worktree's.

scf-core:typecheck clean; biome reports only pre-existing hits on untouched
lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant