Skip to content

fix(kafka): handle tombstone events - #4991

Merged
dreamorosi merged 6 commits into
mainfrom
fix/kafka-tombstone-events
Feb 6, 2026
Merged

dreamorosi merged 6 commits into
mainfrom
fix/kafka-tombstone-events

Conversation

@dreamorosi

@dreamorosi dreamorosi commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Kafka consumer was failing when processing tombstone events (messages with null values) because the value getter attempted to deserialize null values, causing a TypeError when fromBase64 tried to access the length property of null.

Changes

Fixed the issue by adding null and undefined checks to the value getter in the consumer, mirroring the existing logic in the key getter. When a tombstone event is encountered, the consumer now properly returns null instead of throwing an error.

Updated type definitions to allow null values in the deserialization chain and added comprehensive test coverage for both null and undefined value scenarios.

Issue number: closes #4988


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Feb 5, 2026
@pull-request-size pull-request-size Bot added the size/L PRs between 100-499 LOC label Feb 5, 2026
@dreamorosi
dreamorosi marked this pull request as ready for review February 5, 2026 08:49
@dreamorosi
dreamorosi requested a review from svozza February 5, 2026 08:52
- Add null/undefined checks in value getter similar to key getter
- Prevents TypeError when accessing null.length in fromBase64
- Tombstone events now properly return null instead of throwing
- Fixes issue #4988
- Add test case for undefined value to achieve 100% coverage
- Ensures undefined values return undefined as expected
- Replace 'as any' with 'as unknown as string' for better type safety
- Maintains test functionality while avoiding any type usage
@dreamorosi
dreamorosi force-pushed the fix/kafka-tombstone-events branch from fb63162 to a773f0a Compare February 6, 2026 10:55
@dreamorosi
dreamorosi requested a review from svozza February 6, 2026 10:58
@dreamorosi
dreamorosi merged commit 04c3236 into main Feb 6, 2026
49 checks passed
@dreamorosi
dreamorosi deleted the fix/kafka-tombstone-events branch February 6, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L PRs between 100-499 LOC

2 participants