Skip to content
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

Replay count endpoint: validate required parameter #85606

Open
sentry-io bot opened this issue Feb 20, 2025 · 3 comments · May be fixed by #85677
Open

Replay count endpoint: validate required parameter #85606

sentry-io bot opened this issue Feb 20, 2025 · 3 comments · May be fixed by #85677

Comments

@sentry-io
Copy link

sentry-io bot commented Feb 20, 2025

The endpoint requires the query parameter, otherwise it calls several functions deep and fails on calling len(query).

Solution brainstorm: Validate query exists at the API entrypoint, otherwise return 400 indicating missing param

Sentry Issue: SENTRY-2Z7Z

TypeError: object of type 'NoneType' has no len()
(11 additional frame(s) were not displayed)
...
  File "sentry/replays/endpoints/organization_replay_count.py", line 95, in get
    replay_counts = get_replay_counts(
  File "sentry/replays/usecases/replay_counts.py", line 37, in get_replay_counts
    replay_ids_mapping = _get_replay_id_mappings(query, snuba_params, data_source)
  File "sentry/replays/usecases/replay_counts.py", line 72, in _get_replay_id_mappings
    select_column, column_value = _get_select_column(query)
  File "sentry/replays/usecases/replay_counts.py", line 162, in _get_select_column
    parsed_query = parse_search_query(query)
  File "sentry/api/event_search.py", line 1326, in parse_search_query
    tree = event_search_grammar.parse(query)
@bruno-garcia
Copy link
Member

Also note the API docs list the query parameters but dont' indicate what's required: https://docs.sentry.io/api/replays/retrieve-a-count-of-replays/

And the code snippet curl command doesn't have ?query=... in it

@getsantry
Copy link
Contributor

getsantry bot commented Feb 20, 2025

Routing to @getsentry/product-owners-replays for triage ⏲️

@bruno-garcia
Copy link
Member

From @idosun

now I see the description: Return a count of replays for the given issue or transaction ID.
consider changing the page's title to something like Retrieve Replays Count for Issue or Transaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant