Skip to content

Corrupt-but-present workspace aggregate silently blocks re-migration with no error surfaced #300

Description

@BorisTyshkevich

Context

Surfaced during #287 (Dashboard v1 Phase 5) review.

The legacy-migration marker (src/workspace/legacy-migration.ts) keys on raw store-record existence (store.read() !== null), while WorkspaceRepository.loadCurrent() (src/workspace/workspace-repository.ts) deliberately treats an undecodable record as null (a corrupt aggregate is not returned as if valid).

Effect

A corrupt-but-present StoredWorkspaceV1 record:

  1. permanently blocks re-migration (the marker sees "exists"), and
  2. makes loadCurrent() return null, so app.loadWorkspaceOnBoot projects nothing and the session silently continues on the createState() legacy projection with a fresh placeholder workspaceId;
  3. the next successful CRUD commit then writes a brand-new aggregate that orphans the corrupt record — with no user-visible error that recovery failed or data may have been dropped.

Narrow (requires a corrupted IndexedDB record), and no data is silently lost from what's visible (the flat legacy keys are never deleted), but the failure is silent.

Proposed

Surface a toast/diagnostic when loadWorkspaceOnBoot finds a present-but-undecodable aggregate (distinguish "no aggregate yet" from "aggregate unreadable"), and offer an explicit recover/reset path rather than silently minting a new workspace over the corrupt record.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inboxFiled mid-task; not yet triaged into the roadmap

    Type

    No type

    Fields

    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