Skip to Content
Anuma SDKReactInternalFunctionsbackfillMemoryEntityUserIdsOp

backfillMemoryEntityUserIdsOp

backfillMemoryEntityUserIdsOp(ctx: EntityOperationsContext, vaultMemoryCollection: object): Promise<number>

Defined in: src/lib/db/entities/operations.ts:171 

Backfill memory_entity.user_id from the parent vault row’s user_id. Idempotent — only touches rows where user_id is null.

Why this exists: the v31 schema migration backfills via unsafeExecuteSql, which is a no-op on the LokiJS (web) adapter. Native SQLite installs have already been filled by the migration; web installs upgrading through v31 keep user_id=null on every pre-existing memory_entity row until this helper runs.

Consumers wiring an EntityOperationsContext with userId set are obliged to call this once on first use — getMemoriesByEntityNamesOp strictly filters by user_id, so unstamped rows are otherwise invisible to the W5 graph lane.

Parameters

ParameterType

ctx

EntityOperationsContext

vaultMemoryCollection

object

vaultMemoryCollection.find

(id: string) => Promise<{ userId?: string | null; }>

Returns

Promise<number>

Last updated on