MCPcopy Index your code
hub / github.com/simstudioai/sim / deletePreviousVersion

Function deletePreviousVersion

apps/sim/lib/table/snapshot-cache.ts:132–142  ·  view source on GitHub ↗

Best-effort removal of the immediately-prior version (the common single-mutation case).

(
  table: TableDefinition,
  version: number,
  shapeHash: string
)

Source from the content-addressed store, hash-verified

130
131/** Best-effort removal of the immediately-prior version (the common single-mutation case). */
132async function deletePreviousVersion(
133 table: TableDefinition,
134 version: number,
135 shapeHash: string
136): Promise<void> {
137 if (version <= 0) return
138 await deleteFile({
139 key: snapshotKey(table.workspaceId, table.id, version - 1, shapeHash),
140 context: SNAPSHOT_STORAGE_CONTEXT,
141 }).catch(() => {})
142}
143
144/**
145 * Returns the storage key + size of the table's snapshot at its current `rows_version`,

Callers 1

getOrCreateTableSnapshotFunction · 0.85

Calls 2

deleteFileFunction · 0.90
snapshotKeyFunction · 0.85

Tested by

no test coverage detected