Skip to content

fix(customerio): event stream events rejected by record-only connection schema - #5331

Merged
shekhar-rudder merged 1 commit into
hotfix/2-jul-2026from
fix/customerio-connection-schema
Jul 2, 2026
Merged

shekhar-rudder merged 1 commit into
hotfix/2-jul-2026from
fix/customerio-connection-schema

Conversation

@shekhar-rudder

Copy link
Copy Markdown
Member

Summary

  • The getV2InputSchema() Zod schema applied CustomerIOConnectionConfigSchema (which requires object: 'person'|'event') to all events, not just record messages. Event stream messages (identify, track, page, etc.) arriving with a connection object were rejected because their connection config lacks the record-specific object field.
  • Split the input schema into a z.union of two variants: record messages validate connection config against the record-specific schema; event stream messages skip connection validation entirely.
  • Added table-driven tests covering event stream messages with no destination object (VDM v1), nil config, and no connection.

Test plan

  • Unit test proves the bug: event stream message with config: {} connection was rejected before the fix
  • All 9 unit tests pass (routerTransform.test.ts)
  • All 62 Customer.io unit tests pass
  • All 121 Customer.io integration tests pass (processor + router + dataDelivery)

🤖 Generated with Claude Code

@shekhar-rudder
shekhar-rudder requested a review from a team as a code owner July 1, 2026 15:35
@shekhar-rudder
shekhar-rudder requested review from maheshkutty and saikumarrs and removed request for a team July 1, 2026 15:35
@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 65243b5c-3cef-4de1-a2a8-85acd3df3eae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "auto_resolve_threads"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/customerio-connection-schema

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

… schema

The input schema applied CustomerIOConnectionConfigSchema (which requires
`object: 'person'|'event'`) to all events. Non-record messages (identify,
track, etc.) arriving with a connection object were rejected because their
connection config lacks the record-specific `object` field.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@shekhar-rudder
shekhar-rudder force-pushed the fix/customerio-connection-schema branch from aff32eb to 48014be Compare July 1, 2026 15:40
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.72%. Comparing base (b665de6) to head (48014be).

Additional details and impacted files
@@                Coverage Diff                 @@
##           hotfix/2-jul-2026    #5331   +/-   ##
==================================================
  Coverage              92.72%   92.72%           
==================================================
  Files                    701      701           
  Lines                  38134    38134           
  Branches                8964     8965    +1     
==================================================
  Hits                   35360    35360           
- Misses                  2546     2564   +18     
+ Partials                 228      210   -18     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@shekhar-rudder
shekhar-rudder merged commit ee04ae3 into hotfix/2-jul-2026 Jul 2, 2026
28 checks passed
@shekhar-rudder
shekhar-rudder deleted the fix/customerio-connection-schema branch July 2, 2026 05:00
shekhar-rudder added a commit that referenced this pull request Jul 3, 2026
…spatch

Reconcile the record-dispatch framework with develop's schema-driven
BatchDestination refactor (#5315) and the customerio event-stream schema
fix (#5331):

- Re-base VDMV2ObjectDestination onto BatchDestination<TBody, TInputSchema>,
  deriving connection/destination config types from the Zod input schema
  instead of the retired TConfig/TConnectionConfig generics.
- Point customerio's router transform at the schema-driven customerIOInputSchema
  (which now carries the #5331 record-vs-event-stream union) while keeping the
  PR's transformObjectRecord / transformEventStream dispatch.
- Update the framework's VDMV2ObjectDestination tests to the new generic signature.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.

4 participants