From c2334b2cdd7c79704b24cfbb24e6a7f203282b0b Mon Sep 17 00:00:00 2001 From: Harvmaster Date: Mon, 4 May 2026 12:15:39 +0000 Subject: [PATCH] Document that storage should be removed once engine can provide invitation data. Also documented memory adapter should be moved as its only used in the tests --- src/services/storage.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/services/storage.ts b/src/services/storage.ts index 4b4cafc..eb09c89 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -1,6 +1,11 @@ import Database from "better-sqlite3"; import { decodeExtendedJson, encodeExtendedJson } from "../utils/ext-json.js"; +/** + * This is not an actual storage adapter that we want to make use of. This storage adapter is a stop-gap while the engine is under development. + * At the time of writing the storage adapter, the engine provided no way to read data about your currenty invitations, so that is where this is coming in. + * Its providing a Developer facing way to store/read the invitation data and then we can just import them into the engine whenever we want to interact with an invitation. + */ export abstract class BaseStorage { abstract all(): Promise<{ key: string; value: any }[]>; abstract set(key: string, value: any): Promise; @@ -10,6 +15,9 @@ export abstract class BaseStorage { abstract child(key: string): BaseStorage; } +/** + * SQLite Database Storage Adapter. + */ export class Storage extends BaseStorage { static async create(dbPath: string): Promise { // Create the database @@ -134,6 +142,9 @@ export class Storage extends BaseStorage { * * This adapter is useful for tests and short-lived sessions where persisted * SQLite state is not needed. + * + * TODO: Move this somewhere else. There is no reason for this to be in the main codebase. We should put this stricly in the tests beacuse that were its actually being used. + * Ideally, we would provide these kind of generic fills as part of our packages somewhere, but these interfaces dont fit our current design. */ export class InMemoryStorage extends BaseStorage { static async create(): Promise {