Skip to content

@fkn/lib/messages

const ACCOUNT_CHANGED_MESSAGE: "fkn:account-changed" = 'fkn:account-changed';

The account pin’s refusals, as message prefixes the broker throws. ACCOUNT_CHANGED_MESSAGE: the signed-in account is not the one the pin was taken under. ACCOUNT_PIN_INVALID_MESSAGE: the api could not read the pin. ACCOUNT_PIN_UNSUPPORTED_MESSAGE: a hop (the broker document or its shared worker) predates the pin, so the call was refused rather than sent unpinned. None is a sign-out.


const ACCOUNT_PIN_INVALID_MESSAGE: "fkn:account-pin-invalid" = 'fkn:account-pin-invalid';

const ACCOUNT_PIN_UNSUPPORTED_MESSAGE: "fkn:account-pin-unsupported" = 'fkn:account-pin-unsupported';

const E2E_INTEGRITY_MESSAGE: "fkn:e2e-integrity: stored data failed its integrity check" = 'fkn:e2e-integrity: stored data failed its integrity check';

const E2E_LOCKED_MESSAGE: "fkn:e2e-locked" = 'fkn:e2e-locked';

const E2E_RETIRED_FORMAT_MESSAGE: "fkn:e2e-retired-format: stored data is in a format this version no longer opens" = 'fkn:e2e-retired-format: stored data is in a format this version no longer opens';

sealed in an envelope older than v3; distinct from integrity, since the bytes are intact


const E2E_STALE_EPOCH_MESSAGE: "fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset" = 'fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset';

const STORAGE_ACCOUNT_CHANGED: "FKN_ACCOUNT_CHANGED" = 'FKN_ACCOUNT_CHANGED';

The code of StorageAccountChangedError: a call made under one account was refused under another.


const STORAGE_ACCOUNT_PIN_UNSUPPORTED: "FKN_ACCOUNT_PIN_UNSUPPORTED" = 'FKN_ACCOUNT_PIN_UNSUPPORTED';

The code of StorageAccountPinUnsupportedError: the broker cannot pin calls, so none was sent.


const STORAGE_NOT_FOUND: "FKN_STORAGE_NOT_FOUND" = 'FKN_STORAGE_NOT_FOUND';

The error code for “there is no object at this path”, so a caller tests absence instead of parsing a message. osra drops custom codes at the SharedWorker boundary, so account-storage.ts’s rethrow re-mints it from the message on the app side.


const STORAGE_UNREACHABLE: "FKN_API_UNREACHABLE" = 'FKN_API_UNREACHABLE';

The error code for “the api never answered”. A caller that relaxes anything when the server is unreachable must never relax it on an answered error: an answered 500 lands exactly when a key rotation or a setting flip may be propagating. Across the SharedWorker hop the message prefix is the wire contract, since osra drops the code; same-realm callers can test the code.