@mocanvas/store · constant

MigrationFailureReason

declare const MigrationFailureReason: {
    /** The persisted schema names a sequence version higher than this schema knows. */
    readonly TargetVersionTooNew: "target-version-too-new";
    /** The persisted data is older than the oldest migration that survives. */
    readonly TargetVersionTooOld: "target-version-too-old";
    /** A record's type is not registered in this schema and cannot be migrated. */
    readonly UnrecognizedType: "unrecognized-type";
    /** A migration function threw. */
    readonly MigrationError: "migration-error";
    /** The persisted schema itself is malformed. */
    readonly IncompatibleSubtype: "incompatible-subtype";
    /** The persisted schema version is not one this store understands. */
    readonly UnknownSchemaVersion: "unknown-schema-version";
}

Why loading a persisted snapshot failed.

These are the cases worth telling apart in a UI: "this file is from a newer version of the app" is a message a user can act on, and "migrationError" is not.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.