Skip to content

fix(releases): strip trailing slash from ?project= so the page loads - #124243

Open
parh0m2007 wants to merge 1 commit into
getsentry:masterfrom
parh0m2007:fix/117298-project-trailing-slash
Open

fix(releases): strip trailing slash from ?project= so the page loads#124243
parh0m2007 wants to merge 1 commit into
getsentry:masterfrom
parh0m2007:fix/117298-project-trailing-slash

Conversation

@parh0m2007

Copy link
Copy Markdown

Problem

When a release detail URL has a trailing slash on the ?project= parameter value (e.g. .../explore/releases/testrelease@1.0/?project=12345/), the page enters a loading state and then renders blank — no error message, no invalid project warning.

Closes #117298

Root cause

Two behaviors stack:

  1. The backend's ProjectIdOrSlugField validation rejects "12345/" — it is neither a decimal id (isdecimal() fails because of the slash) nor a valid slug (MIXED_SLUG_PATTERN does not allow /) — so the release endpoint responds 400 "Invalid project".
  2. On the frontend, ReleasesDetail deliberately filters 400s out of visibleErrors ("Only show non-400 errors"), so the error is swallowed. release stays undefined, project can't be resolved, and the component returns null — a silent blank page.

Solution

Normalize the project query param on mount in ReleasesDetailContainer: if it carries trailing slashes, strip them and replace the URL (same navigate(..., {replace: true}) pattern already used there to drop global datetime params from the URL). All requests then pick up the cleaned value and the page loads normally.

Recipes

  • Reproduce on master: ?project=12345/ → blank page, no error
  • With the fix: URL rewrites to ?project=12345 and the release detail page loads
  • No trailing slash → URL untouched
  • Added index.spec.tsx covering both cases

Evidence

PASS static/app/views/explore/releases/detail/index.spec.tsx
Tests: 2 passed, 2 total

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

A trailing slash on the ?project= parameter (e.g. ?project=12345/)
fails backend validation: '12345/' is neither a decimal id nor a
valid slug, so ProjectIdOrSlugField rejects it with a 400. Because
ReleasesDetail filters 400 errors out of visibleErrors, the page
silently renders blank instead of showing an error.

Normalize the project param on mount by stripping trailing slashes
and replacing the URL, so all requests pick up the cleaned value.

Fixes getsentry#117298
@parh0m2007
parh0m2007 requested a review from a team as a code owner September 12, 2026 15:30
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release page blank with no error when ?project= has trailing slash

1 participant