Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses onboarding state leaking across account-creation sessions by clearing persisted onboarding values from sessionStorage so subsequent signups/onboarding runs start clean (resolving #951).
Changes:
- Clear onboarding-related
sessionStoragekeys during signup submission. - Clear onboarding-related
sessionStoragekeys after archive creation flow completes. - Add unit tests to verify the
sessionStoragekeys are cleared in both flows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/app/onboarding/components/create-new-archive/create-new-archive.component.ts |
Clears onboarding session storage after onSubmit() and includes onboardingScreen in the cleared keys. |
src/app/onboarding/components/create-new-archive/create-new-archive.component.spec.ts |
Adds a test ensuring onboarding sessionStorage keys are cleared after archive creation. |
src/app/auth/components/signup/signup.component.ts |
Clears onboarding sessionStorage keys at the start of signup submission. |
src/app/auth/components/signup/signup.component.spec.ts |
Adds a test ensuring onboarding sessionStorage keys are cleared when signup is submitted. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/app/onboarding/components/create-new-archive/create-new-archive.component.ts
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #952 +/- ##
==========================================
+ Coverage 48.79% 48.86% +0.07%
==========================================
Files 351 351
Lines 11345 11365 +20
Branches 1899 1904 +5
==========================================
+ Hits 5536 5554 +18
- Misses 5619 5623 +4
+ Partials 190 188 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
30d77c8 to
ca0022b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/app/onboarding/components/create-new-archive/create-new-archive.component.ts
Outdated
Show resolved
Hide resolved
src/app/onboarding/components/create-new-archive/create-new-archive.component.spec.ts
Outdated
Show resolved
Hide resolved
158cd85 to
1a5c89b
Compare
0b3dd0e to
3108334
Compare
53b4192 to
f9443ac
Compare
|
This should finally be ready for review! |
50eb7ef to
888ce75
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| this.clearAccount(); | ||
| this.clearArchive(); | ||
| this.clearRootFolder(); | ||
| sessionStorage.clear(); | ||
| this.accountChange.emit(null); |
There was a problem hiding this comment.
sessionStorage.clear() in logOut() clears all sessionStorage keys (e.g. UI state like showArchiveOptions/showAppsSubfolders), not just onboarding state. This can cause unrelated session-scoped preferences/state to be lost on logout. Consider removing this, or clearing only the onboarding-related keys (e.g. via OnboardingService.clearSessionStorage() / targeted removeItem calls) instead of wiping sessionStorage globally.
There was a problem hiding this comment.
This was my intention but @cecilia-donnelly please note if that is shooting too far.
I do think that it is odd to have any state be carried over between login / logout (e.g. if a family computer is used by two people with different preferences in those settings... shouldn't those preferences be stored outside of a session?)
There was a problem hiding this comment.
I think this is right. It's possible that it will change behavior people are used to, so we might have to address some of that in future support conversations. If options need to be carried over through logout, though, we should store them in the backend (e.g. for the checklist there's the "don't show this again" option, which is stored in the database, but we wouldn't keep the checklist minimized/maximized through a login/logout cycle).
src/app/onboarding/components/create-new-archive/create-new-archive.component.ts
Outdated
Show resolved
Hide resolved
src/app/onboarding/components/create-new-archive/create-new-archive.component.ts
Show resolved
Hide resolved
We were not reliably clearing out onboarding metadata when it finished or when users logged out, which meant that if the same browser was used to create two accounts there could be some contamination of the onboarding step for the second user. This (1) fixes that, and (2) moves the state management to the OnboardingService rather than an individual component. Issue #951 Ensure web archive name is empty during account creation
We had various components writing / reading session storage to look up onboarding flow information. This meant that the responsibility of concerns was fragmented and components were doing "more" than they really should have been responsible for. This moves the mechanism of storage / storage management entirely into the OnboardingService. It's now much easier to ensure things are behaving properly, and components have a much simpler API to interact with onboarding data. Issue #951 Ensure web archive name is empty during account creation
When a user logs out they might have some data in their session storage which should also be wiped away. Issue #951 Ensure web archive name is empty during account creation
The previous implementation of the onboarding flow interacted directly with local storage; however, we have a StorageService which exists to cover edge cases where local storage isn't actually available. This fix should make onboarding more robust, and is in line with the recent refactors to improve that storage.
7dc5f94 to
b64de96
Compare
cecilia-donnelly
left a comment
There was a problem hiding this comment.
This is much clearer, thank you! And it works :)
I did make a ticket for a pre-existing bug that I saw while testing this: https://permanent.atlassian.net/browse/PER-10486
| this.clearAccount(); | ||
| this.clearArchive(); | ||
| this.clearRootFolder(); | ||
| sessionStorage.clear(); | ||
| this.accountChange.emit(null); |
There was a problem hiding this comment.
I think this is right. It's possible that it will change behavior people are used to, so we might have to address some of that in future support conversations. If options need to be carried over through logout, though, we should store them in the backend (e.g. for the checklist there's the "don't show this again" option, which is stored in the database, but we wouldn't keep the checklist minimized/maximized through a login/logout cycle).
QA InstructionsSummaryThis PR addresses issues with improper session storage handling for the onboarding process. It ensures onboarding session data is cleared:
Test ScenariosOnboarding Data Management
Logout Behavior
Regression Risks
Things to Watch For
Generated by QA Instructions Action |
This PR fixes an issue where onboarding data could carry over between onboarding sessions.
Specifically it refactors how the onboarding components interact with session storage, deferring to the OnboardingService as the "source of truth" for both read, write, and state management.
I also made a small improvement to logout to make sure we aren't leaking session data in browser storage after a user has logged out.
Resolves #951