Skip to content

fix(client): pass connectionId through instead of clientKey - #69

Merged
mikemilla merged 1 commit into
mainfrom
fix/client-connection-id
Oct 1, 2026
Merged

mikemilla merged 1 commit into
mainfrom
fix/client-connection-id

Conversation

@thomasschiavone

Copy link
Copy Markdown
Contributor

Summary

CourierClient's constructor mapped connectionId from the wrong prop:

clientKey: props.clientKey,
connectionId: props.clientKey, // was
connectionId: props.connectionId, // now

This meant any connectionId passed to new CourierClient({ ... }) was ignored. The iOS (ios/CourierClientModule.swift:26) and Android (CourierClientModule.kt:51) modules read connectionId directly from the options, so native received the client key as the socket connection ID, or undefined under JWT-only auth.

The bug has been there since the low-level client landed in Aug 2024 (7dbbb31). Impact is likely low in practice because RN uses the native inbox components, which generate their own connection ID.

Changes

  • src/client/CourierClient.tsx: use props.connectionId.
  • src/__tests__/courier-client.test.tsx: two tests, one that connectionId reaches addClient and options, and one that it stays undefined when omitted. Both fail on the old code.

Testing

  • yarn test: 133/133 passing
  • eslint on changed files: clean
  • tsc --noEmit: clean

No version bump. main is already at 6.0.5 (unreleased), so this can ship with it.

🤖 Generated with Claude Code

The CourierClient constructor set `connectionId: props.clientKey`, so a
caller-supplied connectionId was dropped and the native client received the
client key (or undefined under JWT auth) as its socket connection id.

Adds tests covering connectionId passthrough and the undefined default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mikemilla
mikemilla merged commit be31565 into main Oct 1, 2026
3 checks passed
mikemilla added a commit that referenced this pull request Oct 1, 2026
The deploy job ran on Node 20 and upgraded to npm@latest. npm 12 requires
Node ^22.22.2 || ^24.15.0 || >=26, so the Upgrade npm step failed with
EBADENGINE and 6.0.5 never published (runs on #67 and #69).

Use .nvmrc (v22), matching CI, and pin npm 11 (>= 11.5.1 for trusted
publishing; supports Node ^20.17.0 || >=22.9.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mikemilla added a commit that referenced this pull request Oct 1, 2026
The deploy job ran on Node 20 and upgraded to npm@latest. npm 12 requires
Node ^22.22.2 || ^24.15.0 || >=26, so the Upgrade npm step failed with
EBADENGINE and 6.0.5 never published (runs on #67 and #69).

Use .nvmrc (v22), matching CI, and pin npm 11 (>= 11.5.1 for trusted
publishing; supports Node ^20.17.0 || >=22.9.0).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants