Skip to content

fix(local): Open the linked session from a session's viewer link - #2482

Merged
MathurAditya724 merged 3 commits into
mainfrom
fix/local-viewer-session-link
Nov 24, 2026
Merged

MathurAditya724 merged 3 commits into
mainfrom
fix/local-viewer-session-link

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The "View events at" link for a daemon session only pointed at the daemon, so the viewer opened whichever session happened to be first, not the one you just started.

Session output (run --session, serve --session, session create / view) now adds the session ID to the link, and the viewer picks that session when it finds it in the daemon's session list. If the ID isn't there anymore, the viewer opens the first session like before and shows "Session not found, showing " so it's not a silent switch. The link still has no capability in it. The viewer host can see the session ID, but that's not a credential. The viewer drops session from the address bar along with url.

Before:

View events at https://local.sentry.dev/?url=http%3A%2F%2Flocalhost%3A8969%2Fstream
→ viewer opens the first session in the list

After:

View events at https://local.sentry.dev/?url=http%3A%2F%2Flocalhost%3A8969%2Fstream&session=<id>
→ viewer opens session <id>

Pasting a raw session stream URL with its ?cap= into ?url= is still refused, same as today. Capabilities shouldn't go in a query string, so that path stays closed.

via @MathurAditya724.

--

View Session [Sentry]

The "View events at" link for a daemon session pointed at the daemon's
plain /stream, so the viewer opened whichever session came first. Session
output now adds the session ID as a `session` query parameter, and the
viewer selects that session from the daemon's directory, falling back to
the first one when it is not listed. The link still carries no capability,
and the viewer strips `session` from the address bar with `url`.

Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 24, 2026 9:43am UTC
sentry-local Ready Ready Preview Nov 24, 2026 9:43am UTC

Request Review

When a viewer link names a session the daemon no longer lists, the viewer
now shows "Session not found, showing <label>" instead of quietly opening
another session. Also cover the `serve --session` viewer link in tests,
name the run viewer stream once, and note in the docs that the viewer host
can see the session ID, which is not a credential.
Comment thread apps/local/src/App.tsx Resolved
A retry or Connect to the daemon's /stream after the first attempt failed
cleared the linked session ID, so the viewer opened the first session
instead. Only a connection to another target now uses the ID up.

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 1e32cf3 against main including #2480 and #2481. No actionable findings. Typecheck, lint and full workspace tests passed. Independent headless Chrome QA drove the real viewer and real loopback receiver at 1280px and 390px: a public link selected the second session rather than the first; reload retained selection; connection query parameters were consumed; a missing session ID displayed the named fallback notice and opened the first session. Confirmed the public link contains no capability and reviewed the mobile screenshot. Existing integration tests also cover initial stream failure and retry.

@MathurAditya724
MathurAditya724 merged commit f2f557a into main Nov 24, 2026
34 of 35 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/local-viewer-session-link branch November 24, 2026 11:11

This branch was successfully deployed

2 active deployments
Preview – cli — 1e32cf33 Deployed Nov 24, 2026 by vercel[bot]
Preview – sentry-local — 1e32cf33 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant