Skip to content

bugfix(browser): stop overwriting the guid with the session id - #415

Merged
KishanPRao merged 2 commits into
mainfrom
fix/guid-overwrite
Oct 28, 2026
Merged

KishanPRao merged 2 commits into
mainfrom
fix/guid-overwrite

Conversation

@KishanPRao

Copy link
Copy Markdown
Collaborator

Summary

The browser SDK keeps the same guid across sessions, and Backtrace no longer counts each new session as a new user.

Changes

  • BacktraceBrowserSessionProvider.ts: keep the session id and its last-active time under their own storage keys, start a new session when no session id is stored.
  • persistentSessionProviderTests.spec.ts: move the tests to the new keys, cover a missing session id, check the guid key and the old last-active key stay untouched.
  • guidSessionTests.spec.ts: new, cover a guid that differs from the session id and stays the same across sessions and after an upgrade.

Note

Existing users keep their guid and start one new session on upgrade. The old backtrace-last-active key is no longer used.

ref: BT-7911

@KishanPRao
KishanPRao requested a review from melekr October 28, 2026 10:15
@KishanPRao KishanPRao self-assigned this Oct 28, 2026
@KishanPRao KishanPRao added the bug Something isn't working label Oct 28, 2026
@KishanPRao
KishanPRao marked this pull request as ready for review October 28, 2026 12:33
@KishanPRao
KishanPRao merged commit 4c3e252 into main Oct 28, 2026
19 of 20 checks passed
@KishanPRao
KishanPRao deleted the fix/guid-overwrite branch October 28, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants