MCPcopy Create free account
hub / github.com/apache/maka / replaceRecords

Method replaceRecords

packages/storage/src/artifact-store.ts:1237–1254  ·  view source on GitHub ↗
(records: ArtifactRecord[])

Source from the content-addressed store, hash-verified

1235 }
1236
1237 private replaceRecords(records: ArtifactRecord[]): void {
1238 const bySession = new Map<string, ArtifactRecord[]>();
1239 for (const record of records) {
1240 const sessionRecords = bySession.get(record.sessionId);
1241 if (sessionRecords) sessionRecords.push(record);
1242 else bySession.set(record.sessionId, [record]);
1243 }
1244 const snapshots = new Map<string, ArtifactSessionSnapshot>();
1245 for (const [sessionId, sessionRecords] of bySession) {
1246 sessionRecords.sort(compareArtifactRecords);
1247 snapshots.set(sessionId, {
1248 records: sessionRecords,
1249 revision: artifactListRevision(sessionRecords),
1250 });
1251 }
1252 this.records = records;
1253 this.sessionSnapshots = snapshots;
1254 }
1255
1256 private async publishPurgeIntentUnlocked(artifactIds: readonly string[]): Promise<void> {
1257 const contents = JSON.stringify({

Callers 9

deleteMethod · 0.95
completePurgeUnlockedMethod · 0.95
loadMethod · 0.95
bindMutationRootMethod · 0.95

Calls 4

artifactListRevisionFunction · 0.85
getMethod · 0.65
pushMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected