Skip to content

Clear onboarding storage upon completion#952

Open
slifty wants to merge 1 commit intomainfrom
951-archive-name-fix
Open

Clear onboarding storage upon completion#952
slifty wants to merge 1 commit intomainfrom
951-archive-name-fix

Conversation

@slifty
Copy link
Contributor

@slifty slifty commented Mar 3, 2026

This PR fixes an issue where onboarding data could carry over between onboarding sessions.

Resolves #951

Copilot AI review requested due to automatic review settings March 3, 2026 20:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 sessionStorage keys during signup submission.
  • Clear onboarding-related sessionStorage keys after archive creation flow completes.
  • Add unit tests to verify the sessionStorage keys 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.

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.59%. Comparing base (c5d8a43) to head (3108334).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #952      +/-   ##
==========================================
- Coverage   48.69%   48.59%   -0.11%     
==========================================
  Files         350      350              
  Lines       11339    11348       +9     
  Branches     1898     1899       +1     
==========================================
- Hits         5522     5514       -8     
- Misses       5627     5643      +16     
- Partials      190      191       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@slifty slifty force-pushed the 951-archive-name-fix branch 2 times, most recently from 30d77c8 to ca0022b Compare March 3, 2026 20:43
Copilot AI review requested due to automatic review settings March 3, 2026 20:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@slifty slifty force-pushed the 951-archive-name-fix branch 2 times, most recently from 158cd85 to 1a5c89b Compare March 3, 2026 21:00
@slifty slifty added the QA This issue is ready for QA / user acceptance testing label Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

QA Instructions

Summary

This PR resolves issue #951 by ensuring that onboarding session data is cleared after onboarding is completed or when a user logs out. This is achieved by using a new method clearSessionStorage in the OnboardingService to avoid onboarding state contamination between different user accounts. Updates were made to the OnboardingService, SignupComponent, and CreateNewArchiveComponent.


Test Environment Setup

  1. Ensure the application is running in a development environment.
  2. Ensure you can access the signup and onboarding workflows.

Test Scenarios

Signup Component Behavior

  1. Onboarding state cleared after onSubmit in the signup form:

    • Navigate to the signup page.
    • Fill out and submit the signup form with valid details.
    • Expected Result: Verify that the clearOnboarding method of the OnboardingService is invoked during form submission.
  2. Regression Test - Regular Signup functionality:

    • Ensure that a user is successfully created with valid signup details.
    • Expected Result: After signup, the user should be logged in and onboarded without any errors.

Onboarding Workflow Behavior

  1. Session storage clears after successful archive creation:

    • Start a new user onboarding session.
    • Complete the onboarding process and submit an archive creation request.
    • Expected Result: Verify that onboarding session keys (e.g., archiveName, goals, reasons, etc.) are cleared from session storage when the archive is successfully created.
  2. Session storage not cleared if archive creation fails:

    • Start a new user onboarding session.
    • Simulate a failure by configuring the API call to create an archive to return an error (e.g., network or server error).
    • Expected Result: Verify that onboarding session keys are NOT cleared from session storage.
  3. Regression Test - Onboarding workflow:

    • Start and complete the entire onboarding workflow with various valid configurations (e.g., different archiveType and goals).
    • Expected Result: Verify onboarding proceeds to the end, creates the archive successfully, and clears the onboarding session data.

Regression Risks

  1. Signup/Onboarding Critical Path:

    • Verify that changes to session data handling don't cause issues with the signup process or onboarding completion.
  2. Session Storage Handling:

    • Check for unintended side effects when clearing session storage, e.g., other non-onboarding-related session data should remain intact.

Things to Watch For

  1. Service Invocation in All Scenarios:

    • Ensure clearSessionStorage and resetSessionState methods are consistently triggered under their respective conditions.
  2. Edge Cases & Errors:

    • Test scenarios where the onboarding workflow is interrupted (e.g., page refreshes, browser restarts) and verify correct session handling.
  3. Multi-tab Scenarios:

    • Test onboarding and signup flows in multiple tabs to ensure no session conflicts.

Generated by QA Instructions Action

@slifty slifty force-pushed the 951-archive-name-fix branch 2 times, most recently from 1415821 to 0b3dd0e Compare March 3, 2026 21:36
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
@slifty slifty force-pushed the 951-archive-name-fix branch from 0b3dd0e to 3108334 Compare March 3, 2026 21:45
@slifty slifty removed the QA This issue is ready for QA / user acceptance testing label Mar 3, 2026
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.

Ensure web archive name is empty during account creation

2 participants