Skip to content

capture_items

7cde973
Select commit
Loading
Failed to load commit list.
Draft

feat(asgi): Migrate away from event processor in span first #5920

capture_items
7cde973
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed Apr 2, 2026 in 3m 20s

1 issue

find-bugs: Found 1 issue (1 medium)

Medium

capture_items filter logic inverts expected behavior when types is None - `tests/conftest.py:341-342`

The filter condition if types is None or item.type not in types: will skip ALL items when types=None, which inverts the typical filter semantics where None means "capture everything". Currently, calling capture_items() without arguments returns an empty list because every item is skipped. The correct logic should be if types is not None and item.type not in types: to only skip items when a filter is specified and the item doesn't match.


Duration: 3m 19s · Tokens: 2.0M in / 18.1k out · Cost: $3.90 (+extraction: $0.01, +fix_gate: $0.00)

Annotations

Check warning on line 342 in tests/conftest.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

capture_items filter logic inverts expected behavior when types is None

The filter condition `if types is None or item.type not in types:` will skip ALL items when `types=None`, which inverts the typical filter semantics where `None` means "capture everything". Currently, calling `capture_items()` without arguments returns an empty list because every item is skipped. The correct logic should be `if types is not None and item.type not in types:` to only skip items when a filter is specified and the item doesn't match.