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

Reset posthog localStorage if found not to be logged in #3733

Merged
merged 4 commits into from
Apr 16, 2024

Conversation

knolleary
Copy link
Member

When a user logs out we correctly reset posthog state to clear any user-identifying information.

If however the user's session has naturally expired, we need a mechanism to clear the state.

This is a quick fix that resets the posthog state if we find the user is not currently logged in. This doesn't reset the device-id so should not interrupt the intended tracking.

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 42.00%. Comparing base (441bc23) to head (b5913cc).

Files Patch % Lines
frontend/src/store/account.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3733      +/-   ##
==========================================
- Coverage   42.00%   42.00%   -0.01%     
==========================================
  Files         631      631              
  Lines       24549    24550       +1     
  Branches     6003     6003              
==========================================
  Hits        10311    10311              
- Misses      14238    14239       +1     
Flag Coverage Δ
backend 79.12% <ø> (ø)
frontend 1.90% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joepavitt joepavitt merged commit 215cce9 into main Apr 16, 2024
9 of 10 checks passed
@joepavitt joepavitt deleted the reset-posthog-on-session-expiry branch April 16, 2024 12:22
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.

None yet

2 participants