Skip to content

fix(native-swift): codegen and runtime fixes for transferables, unions, names, RPC errors (stack 03/14) - #852

Open
harsh62 wants to merge 1 commit into
auth/stack-02-native-kotlinfrom
auth/stack-03-native-swift
Open

harsh62 wants to merge 1 commit into
auth/stack-02-native-kotlinfrom
auth/stack-03-native-swift

Conversation

@harsh62

@harsh62 harsh62 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Part 03 of 14 of the auth-unification stack · stacked on auth/stack-02-native-kotlin (part 02) · reference PR #711 has the whole change in one commit.
Merge bottom to top. When the PR below merges, GitHub retargets this one to main.

Problem

Swift client generator and runtime fixes, the counterpart of part 02.

Issue #, if available: see #711

Changes

  • Transferables inside models.
  • Union value arms and numeric discriminators.
  • Collision-free nested type names (types move under their parent).
  • Inline-object properties.
  • format: date as String.
  • Public model inits.
  • Sorted keys.
  • The RPC error name.
  • postRawRoute now throws RawRouteError, with the route, the status and the server's error name, for any non-2xx response. It used to read the error body as a success.
  • On top of main's typed results for declared native bindings (feat(swift): emit typed transferable results for declared native bindings #807: declared modules are imported, runtime names qualified as BlocksRuntime., a module shadowed by a generated name is rejected) and its generated Blocks entry point (feat(swift): generate a Blocks entry point so one BlocksClient serves every API #797), both of which this generator keeps: one client per spec, nonisolated generated types for an app's MainActor default isolation, and a realtime result decoded in BlocksRuntime. Here the runtime decodes it with the client's decoder, so a channel message holding a date or an OIDC client decodes too. A nested oidc/client hydrates rather than decoding as JSONValue, and a transferable encodes back to its descriptor.
  • Goldens are regenerated. Fixtures 18 and 23 differ from the final stack until part 05.

What to review closely: Start with native/swift/Sources/BlocksCodegen/. Generated-API changes for customers are listed in L55, L60 and L63; they ship as a minor.

Validation

This branch passed on its own:

  • npm ci, with the lockfile unchanged by npm install
  • lint and lint:deps
  • build
  • the exports, client user-agent and packed-asset checks
  • check:api
  • the action-pin guard and the catalog check
  • all four changeset-guard checks
  • test:unit: 5,942 passed, 0 failed
  • native goldens regenerate with zero drift
  • Swift: golden compile, swift build, codegen and runtime tests, SwiftFormat

The full stack passed end to end on AWS, on new stacks that were destroyed afterwards: upgrade-in-place from AuthCognito, comprehensive sandbox and production, hosting, native, and the CloudFront front door (see #711). That run was on the tree before the latest merges of main (#824's synth guards, #797's Swift Blocks entry point, #834's template metadata, #835/#837's native opt-out warnings, #841, #749, #819 and dependency bumps, then #208's submitAuthAction, #807's Swift typed declared-binding results, #637's config-bucket hardening and more dependency bumps); the merged tree, which part 12 is, passed every local gate, including the native suites and the Swift e2e against a local backend.

Checklist

  • PR description included
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1b81b19

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@harsh62
harsh62 added this pull request to stack #864 October 19, 2026 00:58

This branch had an error being deployed

1 failed (outdated) and 1 inactive deployments
e2e — 1b81b19c Deployed Oct 23, 2026 by harsh62 via Kotlin E2E (iOS, sandbox) #3849
publish — ee7893b6 Deployed Oct 22, 2026 by harsh62 via E2E Hosting (nextjs-web-function) #3629
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