Skip to content

fix: no longer set the last event id for transactions #1186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ sentry-sdk==0.10.1

A major release `N` implies the previous release `N-1` will no longer receive updates. We generally do not backport bugfixes to older versions unless they are security relevant. However, feel free to ask for backports of specific commits on the bugtracker.

## Unreleased

- No longer set the last event id for transactions #1186

## 1.3.1

- Fix detection of contextvars compatibility with Gevent versions >=20.9.0 #1157
Expand Down
3 changes: 2 additions & 1 deletion sentry_sdk/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ def capture_event(
client, top_scope = self._stack[-1]
scope = _update_scope(top_scope, scope, scope_args)
if client is not None:
is_transaction = event.get("type") == "transaction"
rv = client.capture_event(event, hint, scope)
if rv is not None:
if rv is not None and not is_transaction:
self._last_event_id = rv
return rv
return None
Expand Down
5 changes: 5 additions & 0 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def test_event_id(sentry_init, capture_events):
assert last_event_id() == event_id
assert Hub.current.last_event_id() == event_id

new_event_id = Hub.current.capture_event({"type": "transaction"})
assert new_event_id is not None
assert new_event_id != event_id
assert Hub.current.last_event_id() == event_id


def test_option_callback(sentry_init, capture_events):
drop_events = False
Expand Down