Skip to content

fix(command-palette): Preserve orgId in settings navigation URLs - #123699

Draft
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/command-palette-settings-orgid
Draft

fix(command-palette): Preserve orgId in settings navigation URLs#123699
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/command-palette-settings-orgid

Conversation

@sentry

@sentry sentry Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a "Route not found" error when navigating to organization-level settings pages (e.g., Feature Flags) via the command palette, specifically for organizations configured with customer domains.

Root Cause:
When a user searched for a setting (e.g., "new provider" for Feature Flags) from a user-level settings page (e.g., /settings/account/details/), the SettingsCommandPaletteActions component would correctly resolve the URL to include the organization slug (e.g., /settings/doogi/feature-flags/change-tracking/new-provider/). However, the CommandPalette component (in commandPalette.tsx) would then apply normalizeUrl() to this already-resolved path. For customer-domain enabled organizations, normalizeUrl() contains a pattern that incorrectly stripped the real organization slug (e.g., doogi) from the path, resulting in a URL like /settings/feature-flags/change-tracking/new-provider/. The router would then fail to match this route, interpreting feature-flags as the :orgId parameter.

Fix:
The normalizeUrl() function is now applied earlier in SettingsCommandPaletteActions within the resolveRoutePath function. It is applied to the route template before the actual organization slug is substituted. This ensures that:

  • For customer-domain enabled organizations, normalizeUrl() strips the :orgId placeholder from the template (e.g., /settings/:orgId/feature-flags/... becomes /settings/feature-flags/...). The subsequent replaceRouterParams call then becomes a no-op for the :orgId part, and the URL is already in its canonical form.
  • For organizations without customer domains, normalizeUrl() acts as a no-op on the template, and the organization slug is correctly substituted as before.

This change makes the URL canonical before it is passed to the command palette, ensuring that the subsequent normalizeUrl() call in the command palette is idempotent and does not alter the path incorrectly.

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.

Fixes JAVASCRIPT-39JT

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 4, 2026
@sentry sentry Bot changed the title fix(command-palette): Prevent orgId stripping from settings URLs fix(command-palette): Preserve orgId in settings navigation URLs Sep 4, 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.

0 participants