Skip to content

fix(insights): skip pushing events if empty#170

Merged
Haroenv merged 2 commits into
mainfrom
fix/no-empty-events
Nov 18, 2025
Merged

fix(insights): skip pushing events if empty#170
Haroenv merged 2 commits into
mainfrom
fix/no-empty-events

Conversation

@Haroenv

@Haroenv Haroenv commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

CR-9915

Q A
Bug fix? yes
New feature? no
BC breaks? no
Related Issue CR-9915.
Need Doc update no

Describe your change

ensure we don't send an empty payload.

Testing this required a slight change to the event service, as the InsightsClient is final, and can thus not be extended to make a mock. There's now a private "withClient" method that allows a subset of InsightsClient.

What problem is this fixing?

if the events are invalid or empty, we don't send the events, as the insights API returns 422 if you send an empty payload.

if the events are invalid or empty, we don't send the events.

Testing this required a slight change to the event service, as the InsightsClient is final, and can thus not be extended to make  a mock. There's now a private "withClient" method that allows a subset of InsightsClient.

[CR-9915]
@Haroenv
Haroenv requested review from aallam and dhayab November 17, 2025 17:15
@Haroenv

This comment was marked as resolved.

@aallam aallam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Haroenv
Haroenv merged commit 17d7e53 into main Nov 18, 2025
6 checks passed
@Haroenv
Haroenv deleted the fix/no-empty-events branch November 18, 2025 11:50
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.

3 participants