Skip to content

fix(webhook-destination): honor JITSU_TABLE_NAME in batch mode - #1632

Open
pcbeingused333 wants to merge 1 commit into
jitsucom:newjitsufrom
pcbeingused333:fix/webhook-table-name-c3086
Open

pcbeingused333 wants to merge 1 commit into
jitsucom:newjitsufrom
pcbeingused333:fix/webhook-table-name-c3086

Conversation

@pcbeingused333

Copy link
Copy Markdown

Fixes #1628

In batch mode the webhook destination picked the bulker table from event.event || event.type and posted the whole event as the body. The JITSU_TABLE_NAME override (which bulker-destination.ts honors and removes from the payload) was ignored, so every distinct event name opened its own Kafka topic, and the override field leaked into the stored payload.

The batch path now uses event[TableNameParameter] when present, falling back to event.event || event.type as before, and omits the field from the body.

Test: a new webhook-batch-table-name.test.ts runs the destination in batch mode against a mocked bulker endpoint and asserts the tableName query parameter and the body. The override case failed before the change (expected 'button_clicked' to be 'my_table') and passes after; the default case is unchanged. The existing webhook-destination tests still pass. Run with vitest in the destination-functions package; prettier check clean.

AI assistance was used to prepare this change and its validation.

The batch path chose the bulker table from event.event || event.type and
sent the whole event, so a JITSU_TABLE_NAME override was ignored and leaked
into the payload. Use it as the table name when present and strip it from the
body, as the bulker destination does.

This branch has not been deployed

No deployments
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.

Webhook destination in batch mode creates one Kafka topic per event name (JITSU_TABLE_NAME ignored)

1 participant