IFClite TypeScript API
    Preparing search index...

    Disk-backed storage — one file per blob under <dataDir>/blobs/<hash>.

    Mesh blobs are the bulk of a room's data; keeping them in RAM (InMemoryBlobStorage) made memory the dominant hosting cost AND lost every blob on restart (orphaning the doc's geometry refs). Disk is far cheaper per GB than memory on a mounted volume, and durable. Content-addressed, so writes are idempotent. hash is validated as 32 hex chars by the route before it reaches here, so it's safe as a filename (no traversal).

    Implements

    Index
    ready: Promise<void>

    Resolves once <dataDir>/blobs exists, else rejects with the mkdir error. Every method awaits it and so rethrows that error. Await it to fail fast at startup, or before removing dataDir (#6286).

    • Parameters

      • hash: string

      Returns Promise<boolean>

    • Delete a blob only if it is still older than cutoffEpochMs.

      The mtime is re-checked HERE, under the same lock put takes, so a blob re-uploaded between a GC plan and its application survives: put refreshes mtime via a fresh temp file and rename. Returns whether it deleted.

      Parameters

      • hash: string
      • cutoffEpochMs: number

      Returns Promise<boolean>

    • Parameters

      • hash: string

      Returns Promise<boolean>

    • Parameters

      • hash: string
      • bytes: Uint8Array
      • OptionalcontentType: string

      Returns Promise<ServerBlobMeta>