Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't use session storage in memory mode #1521

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

robbie-c
Copy link
Contributor

@robbie-c robbie-c commented Nov 12, 2024

Changes

We currently use sessionStorage even when the persistence is set to memory. This is a bug, which this PR fixes and adds some tests for.

Checklist

  • Tests for new code (see advice on the tests we use)
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Nov 12, 2024 4:22pm

Copy link

Size Change: +720 B (+0.02%)

Total Size: 3.1 MB

Filename Size Change
dist/array.full.es5.js 253 kB +72 B (+0.03%)
dist/array.full.js 355 kB +72 B (+0.02%)
dist/array.full.no-external.js 354 kB +72 B (+0.02%)
dist/array.js 170 kB +72 B (+0.04%)
dist/array.no-external.js 169 kB +72 B (+0.04%)
dist/main.js 171 kB +72 B (+0.04%)
dist/module.full.js 355 kB +72 B (+0.02%)
dist/module.full.no-external.js 354 kB +72 B (+0.02%)
dist/module.js 170 kB +72 B (+0.04%)
dist/module.no-external.js 169 kB +72 B (+0.04%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 204 kB
dist/dead-clicks-autocapture.js 13 kB
dist/exception-autocapture.js 8.8 kB
dist/external-scripts-loader.js 2.19 kB
dist/recorder-v2.js 113 kB
dist/recorder.js 113 kB
dist/surveys-preview.js 56.7 kB
dist/surveys.js 62.1 kB
dist/tracing-headers.js 1.33 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

Copy link
Contributor

@daibhin daibhin left a comment

Choose a reason for hiding this comment

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

Don't have full context on the why behind this change change but looks to do what it says in the test

@robbie-c robbie-c merged commit 6299b7b into main Nov 13, 2024
17 checks passed
@robbie-c robbie-c deleted the fix/dont-use-session-storage-in-memory-mode branch November 13, 2024 15:12
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.

2 participants