Amazon Ergo 1.0 · 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 Opus 5.5.

Gold bugs found
5 of 14
Comments published
6
Comments matching a bug
5
Comments not matching
1
Cost of this PR
$24.533

Published comments (6)

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

Feature-flagged table visualization renders empty data — Enabling `use-table-widget-visualization` replaces fetched `tableResults` with hard-coded empty `columns` and `tableData`, so populated dashboard tables render empty. Pass `columns` built from `fields` and `tableData` built from `result.data` and `result.meta` to `TableWidgetVisualization`.

mediumbugtests/sentry/replays/tasks/test_delete_replays_bulk.py:94-99

Mocked delete_matched_rows leaves the None-segment guard untested — Mocking `delete_matched_rows` means the `max_segment_id=None` row never reaches `_make_recording_filenames`, so this test would still pass if its None guard were removed. Test `_make_recording_filenames` directly, or run `delete_replay_recordings` with storage mocked, asserting that the row yields no filenames.

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

Validation-failure log exposes raw browser reports — Logging `raw_report` can persist URL query tokens, user agents, and free-form bodies containing PII from this unauthenticated, CSRF-exempt endpoint. Log only report type, destination, and validation error fields, or redact URL query strings and body content first.

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

Error details can be paired with the wrong event IDs — `get_multi` is keyed by node ID, so zipping `error_ids` with `events.values()` misattributes titles, messages, and timestamps whenever keys are missing or reordered. Build each result by looking up its node ID with `events.get(node_id)` instead of relying on value order.

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

Zero-valued age and timestamp bypass mutual-exclusivity validation — Reports with both `age: 0` and `timestamp: 0` pass validation because `self.initial_data.get('age')` and `self.initial_data.get('timestamp')` treat zero as absent. Use `'age' in self.initial_data` and `'timestamp' in self.initial_data` to enforce mutual exclusivity.

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

Falsy custom cell renderer output is replaced by default renderers — Valid falsy output such as `0`, `''`, or `null` from `renderTableBodyCell` is discarded by `if (cell)`, so default body and header renderers replace custom content. Check `cell !== undefined` in both paths, falling back only when the renderer returns `undefined`.

Gold bugs found (5)

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

Gold bugs missed (9)

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.
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.
mediumdelete_replays_script_async in replays/tasks.py still does range(0, max_segment_id) without a None check, so replays with no ingested segments raise TypeError, the case the PR fixed only in _make_recording_filenames.
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.
mediumError event timestamps (seconds) are compared with replay recording event timestamps (milliseconds), so errors are not interleaved chronologically with breadcrumbs.
mediumanalyze_recording_segments gets every error in the replay on every paginated page, and gen_request_data emits all of them each time (earlier ones before the first event, the rest at the end), so every page repeats the replay's errors and attaches them to breadcrumbs from other time ranges.
mediumThe breadcrumb-summary endpoint forwards the client's ?field= params into process_raw_response, which only needs error_ids: an unknown field raises KeyError (HTTP 500), and a field list without error_ids silently drops all error context from the summary.
mediumThe rewritten browser-reporting collector tests no longer post with content_type='application/reports+json', so the endpoint's BrowserReportsJSONParser and the reporting media type it exists for are untested; a broken parser would go unnoticed.