Skip to content

Fix account switching causing data loss and forced re-onboarding after re-login #983

Closed

Description

@Al629176

Summary

Fix account switching/session persistence bug where logging out, logging into another account, then returning to the first account causes full re-onboarding and loss of prior chat/login/connection data.

Problem

When a user:

  1. logs out of account 1,
  2. logs into account 2,
  3. logs back into account 1,

the app treats account 1 like a fresh user and sends them through the full onboarding/login flow again. Existing account 1 data appears missing, including:

  • chat history
  • login/session state
  • connected integrations / connection data

Expected Behavior

  • Returning to account 1 should restore account 1 state.
  • Existing chat history should remain available.
  • Connected integrations should remain linked.
  • User should not be forced through full onboarding again unless account truly has no onboarding state.

Scope

  • Reproduce logout/account-switch/account-return flow.
  • Audit account-scoped storage and persisted state keys.
  • Ensure chat data, login data, onboarding completion, and connection data are scoped per account/user ID.
  • Fix any state reset/clear logic that wipes all accounts instead of active account/session only.
  • Rehydrate correct account state after login.
  • Add safeguards to prevent cross-account data leakage while preserving each account's own data.
  • Add logs for account switch, state clear, and state restore operations.

Acceptance Criteria

  • Account 1 data is restored after switching to account 2 and back.
  • User is not re-onboarded if account 1 already completed onboarding.
  • Chat history and integrations remain attached to the correct account.
  • Logging out does not delete persistent account data unless explicitly requested.
  • No cross-account data leakage occurs.
  • Tests cover account switch and re-login persistence behavior.

Activity

  1. Al629176 commented on Apr 27, 2026

    @Al629176
    ContributorAuthor

    Linked to parent issue #972.

  2. moved this from Todo to In progress in Team Openhumanon Apr 28, 2026
  3. added 3 commits that reference this issue on Apr 28, 2026
    78836af
    5bc4e55
    5e41326
  4. changed the title [-]Fix account switching: data loss and forced re-onboarding after re-login[/-] [+][Bug] Fix account switching causing data loss and forced re-onboarding after re-login[/+] on May 3, 2026
  5. changed the title [-][Bug] Fix account switching causing data loss and forced re-onboarding after re-login[/-] [+]Fix account switching causing data loss and forced re-onboarding after re-login[/+] on May 3, 2026
  6. added theissue type on May 3, 2026
  7. added
    taskWork item that is not primarily a bug or a feature.
    react-uiReact app work in app/src: pages, components, providers, store, and UX.
    auth-onboardingLogin, session, onboarding, invites, and first-run UX.
    config-workspaceConfig loading, env overrides, workspace storage, and app state.
    and removed on May 3, 2026
  8. YellowSnnowmann commented on May 5, 2026

    @YellowSnnowmann
    Member

    The issue has already been fixed and no further updation is needed for this issue. Tested it end to end!
    When I tested it end to end, the messages and connections persists for account 1.

  9. moved this from In progress to In review in Team Openhumanon May 5, 2026
  10. moved this from In review to In progress in Team Openhumanon May 15, 2026
  11. added a commit that references this issue on May 15, 2026
    968465f
  12. moved this from In progress to Done in Team Openhumanon May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

auth-onboardingLogin, session, onboarding, invites, and first-run UX.config-workspaceConfig loading, env overrides, workspace storage, and app state.react-uiReact app work in app/src: pages, components, providers, store, and UX.taskWork item that is not primarily a bug or a feature.

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions