Skip to content

fix!: drop only the invalid event, not its whole batch - #1052

Open
eli-r-ph wants to merge 2 commits into
v1-sync-main-7.68from
v1-wire-hygiene
Open

eli-r-ph wants to merge 2 commits into
v1-sync-main-7.68from
v1-wire-hygiene

Conversation

@eli-r-ph

@eli-r-ph eli-r-ph commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Stacked on #1051. Capture v1 rejects the whole request for some invalid events, such as one containing NaN or a non-string name, so one bad event loses every event sent with it. This PR drops only the bad event, raises the analytics size limit to capture's own, and keeps event content out of logs.

Changes

  • An event with a missing, empty or non-string name is dropped, with one warning per reason.
  • An event that contains NaN or Infinity is dropped alone instead of breaking the request.
  • A property or option key that JSON cannot represent, such as a tuple, is dropped from its event.
  • The analytics per-event limit is now 10 MiB, capture's request limit, instead of 900 KiB.
  • A personal API key (phx_...) disables the client with one error log, like an empty key.
  • Logs no longer include event content or invalid timestamp values.
  • Migration guide and changeset updated.

💚 How did you test it?

  • Tests cover each drop, including a name set by before_send, and check that the rest of the batch is still sent.
  • The NaN and event-name tests fail with the change reverted.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Written with Claude Code under the direction of the assignee.

🤖 Generated with Claude Code

@eli-r-ph eli-r-ph self-assigned this Oct 13, 2026
@eli-r-ph
eli-r-ph marked this pull request as ready for review October 13, 2026 05:27
@eli-r-ph
eli-r-ph requested a review from a team as a code owner October 13, 2026 05:27
@eli-r-ph eli-r-ph changed the title fix: drop only the invalid event, and size analytics by capture's limits fix!: drop only the invalid event, not its whole batch Oct 13, 2026
eli-r-ph and others added 2 commits October 13, 2026 20:48
An event with a missing, empty or non-string name, or one that cannot be
serialized (for example with NaN), is dropped alone instead of failing the
whole batch at capture. A property key JSON cannot represent is dropped from
its event. The analytics per-event limit is capture's 10 MiB request limit,
since capture reports an event over its per-event limit in the response.
A personal API key disables the client like an empty key, and logs no longer
include event content or invalid timestamp values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t_utils

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

1 participant