Skip to content

Commit

Permalink
Don't send :integration_meta field
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide committed Aug 28, 2024
1 parent 6a971dd commit 116140d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sentry/event.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ defmodule Sentry.Event do
def remove_non_payload_keys(%__MODULE__{} = event) do
event
|> Map.from_struct()
|> Map.drop([:original_exception, :source, :attachments])
|> Map.drop([:original_exception, :source, :attachments, :integration_meta])
end

create_event_opts_schema = [
Expand Down
16 changes: 16 additions & 0 deletions test/sentry/client_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ defmodule Sentry.ClientTest do

assert %{frames: nil} = get_in(client.threads, [Access.at(0), :stacktrace])
end

test "removes non-payload fields" do
event = %Sentry.Event{
event_id: "abc123",
timestamp: DateTime.utc_now(),
original_exception: RuntimeError.exception("Original exception"),
integration_meta: %{some_key: "some_value"}
}

rendered = Client.render_event(event)

refute Map.has_key?(rendered, :original_exception)
refute Map.has_key?(rendered, :integration_meta)
refute Map.has_key?(rendered, :attachments)
refute Map.has_key?(rendered, :source)
end
end

describe "send_event/2" do
Expand Down

0 comments on commit 116140d

Please sign in to comment.