Skip to content

Deprecate User model and merge into Account model #59277

Description

@MariaHCD

Problem:

We have two models in the App that essentially represent the same thing: User and Account and this leads to a risk of duplicated information. A recent example is the that we have both user.validated and account.validated which both indicate if the account is validated and that caused this issue: #58682

Solution:

Deprecate User.ts and merge it into Account.ts - this will:

  • Prevent duplication information from being added to both models
  • Align with how we structure things in the BE codebase where we user an Account lib (not a User lib).

Migration plan to allow us to transition from using the Account Onyx key in favor of the User Onyx key:

  1. Model Consolidation: Introduce all fields from the User model into the Account model—both in the App and the API.
    • If there are any Onyx updates for Account currently being queued from Web, move that logic to Auth to reduce fragmentation.
  2. Gradual Migration: Update all usages of ONYXKEYS.USER in the App codebase incrementally to prevent regressions or broken functionality.
  3. Cleanup: Once all usages of ONYXKEYS.USER are removed in the App, deprecate and remove all instances of OnyxKeys::USER in the API.

Caveat:

In the API layer, we have a User lib while the Account lib is mostly used for storing constants. So this solution would not be exactly consistent with Web-E.

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @inimaga

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

FirstPickEngineering only, please! Only add when there is an identified code solution.InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewWeeklyKSv2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions