MQT-schemas bump + tests#473
Conversation
Consumers receive messages that have already been parsed by the consumer schema, so ConsumerMessageSchema and AllConsumerMessageSchemas should resolve to z.output rather than z.input. For schemas without transforms both types are identical, so this changes nothing. They diverge once a schema uses transforms or preprocess (e.g. a field that tolerantly drops unknown enum values): there z.input degrades to unknown and breaks typing in message handlers, while the handler actually receives the parsed output. Publisher-side types intentionally stay z.input, since publishers pass the raw payload that the schema parses on emit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds type-test suites verifying that event emitters and message handlers correctly infer handler input and emit output types from Zod schemas that use preprocessing transforms. A dependency update to ChangesType Verification for Schema Transformations
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
CI is red because core's type tests exercise the new z.output consumer types, but core resolves @message-queue-toolkit/schemas from the npm registry (^7.0.0), which still ships the old z.input types. This will resolve itself once #472 is merged and a new schemas version is published — I've verified locally that all type tests pass when core compiles against the fixed schemas package. |
The bump will be done before merging and once #472 is mergeg
Summary by CodeRabbit
Tests
Chores