Kimi K3.1 Pro · Balanced

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

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

The normal review, with one generalist agent. Judge: Claude Haiku 5.5.

Gold bugs found
7 of 10
Comments published
8
Comments matching a bug
7
Comments not matching
1
Cost of this PR
$3.778

Published comments (8)

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

Zero-valued age and timestamp bypass mixed-format validation — Both cross-field validators test the other field with truthiness, so a report containing `age: 0` and `timestamp: 0` passes even though mixed report-format fields are meant to be rejected. Check field membership with `"age" in self.initial_data` and `"timestamp" in self.initial_data` instead of `.get()`.

mediumbugsrc/sentry/issues/endpoints/browser_reporting_collector.py:45-48

Serializer accepts reports with neither age nor timestamp — Marking both `age` and `timestamp` optional without object-level validation accepts reports containing neither field, which match neither supported report shape. Add `validate()` to require exactly one of the two fields while preserving the mutual-exclusion checks.

mediumperformancesrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:104-118

`fetch_error_details` passes the replay's entire unbounded error-ID aggregation to… — Cap or sample the IDs before the multi-get and enforce a prompt-size budget.

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

When `use-table-widget-visualization` is enabled, the component discards `result.data` and… — Pass the fetched result into `TableWidgetVisualization`, or keep `StyledSimpleTableChart` until that adapter is implemented.

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

Falsy custom cell values incorrectly trigger default rendering — The truthiness checks here and in `renderDefaultHeadCell` override valid custom `null`, empty-string, zero, or `false` results even though the API specifies fallback only for `undefined`. Use `cell !== undefined` in both renderers so custom blank and zero-valued cells are preserved.

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

Query key omits organization, causing cross-organization cache reuse — The React Query key omits the organization even though `queryFn` fetches an organization-scoped endpoint, so switching organizations with identical filters can reuse the previous organization's cached attribute keys. Include `organization.slug` or the full endpoint URL in `queryKey`.

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

Hidden attributes remain visible when the search query is empty — The hidden-attribute predicate runs only during a nonempty search because the empty-search branch returns `sorted` directly, leaving `is_segment`, `project_id`, and `received` visible in the default view. Filter `HIDDEN_ATTRIBUTES` before the empty-search return, then apply the search predicate.

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

Replay aggregation query runs when error context is disabled — When `enable_error_context=false`, the endpoint still executes the full replay-aggregation Snuba query and processes its response before discarding `error_ids`, adding an unnecessary network query to every disabled-context request. Evaluate the flag before this block and skip replay querying and response processing when error context is disabled.

Gold bugs found (7)

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 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.
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.
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.

Gold bugs missed (3)

mediumThe validation-failure warning logs the entire raw, attacker-controlled browser report instead of a redacted subset.
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.
mediumError event timestamps (seconds) are compared with replay recording event timestamps (milliseconds), so errors are not interleaved chronologically with breadcrumbs.