Skip to content

bug(auth): Auth/AccountId and Auth/DriveId duplicate Persistence/ValueObjects types with wrong base type #43

Description

@jaybarden1

Problem

Auth/AccountId.cs and Auth/DriveId.cs define sealed record (reference types). Canonical versions of the same concepts already exist as readonly record struct (value types, stack-allocated) in Persistence/ValueObjects/AccountId.cs and Persistence/ValueObjects/DriveId.cs.

This creates two competing types for the same domain concept with different semantics, allocations, and equality behaviour. onedrive-persistence.md is explicit: "Always readonly record struct — value semantics, no null, stack-allocated."

Required fix

  1. Delete Auth/AccountId.cs and Auth/DriveId.cs
  2. Update Domain/OneDriveAccount.cs and Auth/AuthResult.cs to use the canonical types from Persistence/ValueObjects/
  3. Update all call sites in Auth/AuthService.cs, Wizard/AddAccountWizardViewModel.cs, Workspace/WorkspaceViewModel.cs etc. to reference the single canonical namespace
  4. The factory method on Auth/AccountId (Create(string)) should not be needed — construction is direct: new AccountId(value) as per the value-object convention

Rule reference

@.claude/rules/onedrive-persistence.md — Strongly-typed domain value types

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions