Kimi K3.1 Pro · Heavy

replays-self-serve-bulk-delete-system-sentry

Sentry · Python · M · 100–299 lines · 3 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
8 of 10
Comments published
10
Comments matching a bug
8
Comments not matching
2
Cost of this PR
$6.626

Published comments (10)

mediumperformancesrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:67-89

Disabled error context still triggers a replay Snuba query — Even when `enable_error_context=false`, the endpoint executes `query_replay_instance` and processes its response before checking the flag, adding an unnecessary Snuba query to every opted-out summary request. Move the flag check before the Snuba call and skip replay lookup entirely when error context is disabled.

mediumbugstatic/app/views/explore/hooks/useTraceItemAttributeKeys.tsx:39-42

Trace attribute query cache is shared across organizations — The React Query key omits `organization.slug` even though the fetch URL depends on it, so identical filters in two organizations share cached attribute keys and can show the previous organization's schema. Include the organization or full endpoint path in `queryKey`.

mediumsecuritysrc/sentry/issues/endpoints/browser_reporting_collector.py:111-114

Raw browser reports are exposed in validation-failure logs — Avoid logging `raw_report` in this new validation-failure warning. Browser report bodies and URLs can contain sensitive document or blocked-resource URLs, query parameters, and page-specific content, so this creates an additional warning-level copy of untrusted sensitive data in application logs.

mediumbugsrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:164-168

Paginated batches repeat replay-wide errors on unrelated breadcrumbs — `error_events` contains every error in the replay, but `gen_request_data` yields all remaining entries after each paginated segment batch. Subsequent pages therefore repeat errors and attach them to unrelated breadcrumbs; scope errors to the current page's segment/time range instead of flushing the full replay-wide list on every page. **Also found in:** - `src/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:134-139`

mediumbugsrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:107-119

Error details can be associated with the wrong error ID — `get_multi` returns a mapping keyed by node ID, but zipping `error_ids` with `events.values()` treats it as an ordered positional result list. If backend result order differs from `error_ids`, or an entry is omitted for a missing node, an event's title/message/timestamp can be assigned to the wrong error ID; filtering `None` after the zip cannot restore alignment.

mediumbugsrc/sentry/issues/endpoints/browser_reporting_collector.py:50-59

Falsy age and timestamp values bypass mutual-exclusion validation — Both cross-field validators use truthiness, so a report containing both `timestamp: 0` and `age: 0` passes validation despite the fields being mutually exclusive. Test explicit key presence in `initial_data` rather than the values' truthiness.

mediumbugstatic/app/views/dashboards/widgetCard/chart.tsx:164-174

The feature-flagged path renders hard-coded empty columns and data instead of the actual `result`… — Organizations with `use-table-widget-visualization` enabled will see an empty table even when rows were returned. Pass the real result data and derived columns to `TableWidgetVisualization`, or retain the existing renderer until that mapping exists.

mediumbugstatic/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/attributes.tsx:65-68

Hidden attributes remain visible when the search query is empty — `HIDDEN_ATTRIBUTES` is checked only in the search-filtering branch. Because the no-search path returns `sorted` earlier, `is_segment`, `project_id`, and `received` remain visible normally and disappear only while searching.

mediumbugstatic/app/views/dashboards/widgets/tableWidget/defaultTableCellRenderers.tsx:70-73

Falsy custom cell values incorrectly trigger fallback rendering — The renderer contract reserves `undefined` for fallback rendering, but `if (cell)` also discards valid falsy React nodes. In particular, a custom body renderer returning the number `0` will unexpectedly render the default field formatter instead of zero.

mediumbugsrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:153-155

Mixed timestamp units break chronological error merging — The merge compares nodestore error timestamps in seconds with outer RRWeb event timestamps in milliseconds, so real errors compare earlier than the first breadcrumb and are emitted at the beginning instead of in chronological order. Normalize both timestamps to the same unit before sorting and merging, and cover the path with a realistic 13-digit RRWeb timestamp.

Gold bugs found (8)

mediumThe age/timestamp mutual-exclusion validators check truthiness via initial_data.get(), so a zero value is treated as absent and a report carrying both fields passes validation.
mediumThe validation-failure warning logs the entire raw, attacker-controlled browser report instead of a redacted subset.
mediumThe Snuba replay lookup for error IDs runs even when enable_error_context=false, adding a needless query (and failure point) to opt-out requests.
highWith the use-table-widget-visualization flag on, the widget renders TableWidgetVisualization with hardcoded empty columns and data instead of the query results, so every table widget shows an empty table.
mediumThe custom cell renderers fall back to default rendering on any falsy return (0, '', null), not only undefined, so a renderer cannot render zero or an empty cell.
mediumThe attribute-keys query key no longer includes the organization slug, so two organizations with the same filters share a cache entry and switching orgs can show the previous org's attribute names.
mediumHIDDEN_ATTRIBUTES is applied only when a search query is present; the no-search early return shows all attributes, so the hidden attributes still appear in the default span attributes view.
mediumError event timestamps (seconds) are compared with replay recording event timestamps (milliseconds), so errors are not interleaved chronologically with breadcrumbs.

Gold bugs missed (2)

mediumEvery paginated breadcrumb-summary request queries the replay and fetches all of its error events from nodestore with no cap, adding latency and memory proportional to the replay's error count on each page.
mediumThe bulk delete test sets max_segment_id to None to cover the new guard in _make_recording_filenames, but it mocks delete_matched_rows, so the guard is never executed and removing it would not fail the test.