Skip to content

fix(settings): reliably show session replay ID#3843

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/daily-issue-review-885d
Draft

fix(settings): reliably show session replay ID#3843
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/daily-issue-review-885d

Conversation

@cursor

@cursor cursor Bot commented Apr 20, 2026

Copy link
Copy Markdown

Why does this PR exist?

Closes #3271

Session recording can be toggled on, but the replay/session ID is often still unavailable on the first immediate lookup. That leaves the Settings UI without the ID users need to share for debugging.

What does this pull request do?

  • Adds getReplaySessionIdWithRetry() in src/app/components/Settings/.
  • Uses the helper in Settings when:
    • enabling session recording (optionally starts replay and retries for ID), and
    • loading existing session info on mount (read-only retry without forcing replay start).
  • Keeps existing failure behavior safe (no hard errors in UI if replay is unavailable).
  • Adds focused unit tests for the helper:
    • returns existing ID immediately,
    • retries until ID becomes available,
    • returns empty string when still unavailable,
    • still retries when start() throws.

Testing this change

  • yarn test src/app/components/Settings/getReplaySessionIdWithRetry.test.ts --runInBand
  • npx eslint src/app/components/Settings/getReplaySessionIdWithRetry.ts src/app/components/Settings/getReplaySessionIdWithRetry.test.ts

Additional Notes (if any)

This is intentionally scoped to ID retrieval robustness and does not change Sentry replay initialization semantics outside the Settings interaction path.

Open in Web View Automation 

cursoragent and others added 2 commits April 20, 2026 08:11
Co-authored-by: Jan Six <six.jan@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>
@changeset-bot

changeset-bot Bot commented Apr 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e66f676

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

@codacy-production

codacy-production Bot commented Apr 20, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 18 complexity · 0 duplication

Metric Results
Complexity 18
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@github-actions

Copy link
Copy Markdown
Contributor

Commit SHA:82c3abc9c67229c4d9c89922496e4537ac62aa25

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: cursor/daily-issue-review-885d 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 61.52 (0.05) 52.96 (0.06) 59.33 (0.04) 61.91 (0.04)
🟢 packages/tokens-studio-for-figma/src/app/components/Settings/Settings.tsx 61.76 (2.31) 30 (-1.25) 71.42 (0) 61.76 (2.31)
✨ 🆕 packages/tokens-studio-for-figma/src/app/components/Settings/getReplaySessionIdWithRetry.ts 100 100 100 100

@github-actions

Copy link
Copy Markdown
Contributor

Commit SHA:82c3abc9c67229c4d9c89922496e4537ac62aa25
Current PR reduces the test coverage percentage by 1 for some tests

@anathaniel-TS

Copy link
Copy Markdown

🛡️ Hyma Compliance Check

⚠️ 1 finding(s) across 1 file(s)

Severity Category File Headline
🟢 LOW Policy Gap src/app/components/Settings/Settings.tsx Session-replay start now force-triggered on recording toggle
Full finding details

[Policy Gap] Session-replay start now force-triggered on recording toggle

  • File: src/app/components/Settings/Settings.tsx (lines 42-75)
  • Implication: When a user enables session recording, the Settings flow now calls replay.start() (Sentry session replay) and retries to obtain the replay/session ID, where previously the ID was read passively. Sentry session replay is an existing telemetry subprocessor that captures user session recordings; force-starting it changes the telemetry activation path. The change remains gated behind the explicit user toggle (consent preserved) and does not add a new subprocessor or alter Sentry init semantics outside the Settings interaction path, so impact is informational.
  • Recommended action: Before/after merging, confirm the session-recording toggle copy and privacy notice accurately reflect that toggling on actively starts Sentry replay capture, and that Sentry session replay remains documented in the subprocessor list / ROPA telemetry entry.

ℹ️ This check is informational — findings do not block merging.
🛡️ Hyma Compliance Check · automated

@anathaniel-TS

Copy link
Copy Markdown

🛡️ Hyma Compliance Check

⚠️ 1 finding across 1 in-scope file

Severity Category File Headline
🟢 LOW Subprocessor src/app/components/Settings/getReplaySessionIdWithRetry.ts Sentry Session Replay start/retrieve reliability change
Full finding details

[Subprocessor] Sentry Session Replay start/retrieve reliability change

  • File: src/app/components/Settings/getReplaySessionIdWithRetry.ts (new), src/app/components/Settings/Settings.tsx (lines 43–75)
  • Implication: Adds retry logic that force-starts Sentry Session Replay (replay.start()) and reads the replay session ID when the user enables session recording in Settings. Session Replay is a privacy-sensitive subprocessor (records user session activity). This PR does not add Sentry — recording remains gated behind an explicit user checkbox — but it makes replay start more aggressive on opt-in.
  • Recommended action: Confirm Sentry (Session Replay) is on the subprocessor register and disclosed in the privacy policy, and that replay masking/PII-scrubbing config is enabled so recorded sessions do not capture personal data.

ℹ️ This check is informational — findings do not block merging.
🛡️ Hyma Compliance Check · automated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No ID Displayed When Enabling Session ID

2 participants