({
document,
documentName,
lastTransactionOrigin,
lastContext: _lastContext,
})
| 1285 | }, |
| 1286 | |
| 1287 | async onStoreDocument({ |
| 1288 | document, |
| 1289 | documentName, |
| 1290 | lastTransactionOrigin, |
| 1291 | lastContext: _lastContext, |
| 1292 | }) { |
| 1293 | if (isSystemDoc(documentName)) return; |
| 1294 | if (isConfigDoc(documentName)) { |
| 1295 | await storeConfigDoc(document, documentName, lastTransactionOrigin, configPersistenceCtx); |
| 1296 | return; |
| 1297 | } |
| 1298 | if (isManagedArtifactDoc(documentName)) { |
| 1299 | const outcome = await storeManagedArtifactDoc( |
| 1300 | document, |
| 1301 | documentName, |
| 1302 | lastTransactionOrigin, |
| 1303 | managedArtifactCtx, |
| 1304 | ); |
| 1305 | if (outcome === 'persisted') { |
| 1306 | const writer = resolveWriterFromOrigin(lastTransactionOrigin, getPrincipal); |
| 1307 | if (writer && writer.id !== SERVICE_WRITER.id && !writer.id.startsWith('agent-')) { |
| 1308 | const attribution = managedArtifactContributorAttribution(documentName); |
| 1309 | if (attribution) { |
| 1310 | recordContributor( |
| 1311 | attribution.docKey, |
| 1312 | writer.id, |
| 1313 | writer.name, |
| 1314 | writer.id, |
| 1315 | attribution.subject, |
| 1316 | ); |
| 1317 | scheduleGitCommit(); |
| 1318 | } |
| 1319 | } |
| 1320 | } |
| 1321 | return; |
| 1322 | } |
| 1323 | if (isBatchInProgress()) { |
| 1324 | deferStore({ document, documentName, lastTransactionOrigin }); |
| 1325 | return; |
| 1326 | } |
| 1327 | return storeDocumentNow({ |
| 1328 | document, |
| 1329 | documentName, |
| 1330 | lastTransactionOrigin, |
| 1331 | }); |
| 1332 | }, |
| 1333 | }; |
| 1334 | |
| 1335 | async function waitForPendingCommits(): Promise<void> { |
nothing calls this directly
no test coverage detected