Skip to content

fix(trace): Use safe localStorage wrapper in trace preferences - #121042

Draft
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/trace-preferences-localstorage
Draft

fix(trace): Use safe localStorage wrapper in trace preferences#121042
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/trace-preferences-localstorage

Conversation

@sentry

@sentry sentry Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Replaces direct calls to global localStorage.getItem() and localStorage.setItem() in static/app/views/performance/newTraceDetails/traceState/tracePreferences.tsx with the localStorageWrapper from sentry/utils/localStorage.

This prevents a TypeError: can't access property "getItem", localStorage is null when window.localStorage is unavailable (e.g., in Firefox with DOM storage disabled), which caused crashes on the issue details page when viewing trace previews. The wrapper provides graceful fallback to an in-memory store.

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-3B6X

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 2, 2026
@sentry sentry Bot changed the title fix(trace-details): Use safe localStorage wrapper for trace preferences fix(trace): Use safe localStorage wrapper in trace preferences Aug 2, 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