MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / markReferencesFailed

Method markReferencesFailed

src/db/queries.ts:2296–2309  ·  view source on GitHub ↗

* Mark refs a completed resolution pass could not resolve as status='failed' * instead of deleting them (#1240). Failed rows are invisible to the pending * count/batch readers (so drain loops and the #1187 orphan sweep still * terminate) but stay queryable by name_tail so a later sync can r

(refs: Array<{ fromNodeId: string; referenceName: string; referenceKind: string }>)

Source from the content-addressed store, hash-verified

2294 * tail the first time they're attempted.
2295 */
2296 markReferencesFailed(refs: Array<{ fromNodeId: string; referenceName: string; referenceKind: string }>): number {
2297 if (refs.length === 0) return 0;
2298 const stmt = this.db.prepare(
2299 "UPDATE unresolved_refs SET status = 'failed', name_tail = ? WHERE from_node_id = ? AND reference_name = ? AND reference_kind = ?"
2300 );
2301 let changed = 0;
2302 const markMany = this.db.transaction((items: typeof refs) => {
2303 for (const ref of items) {
2304 changed += stmt.run(referenceNameTail(ref.referenceName), ref.fromNodeId, ref.referenceName, ref.referenceKind).changes;
2305 }
2306 });
2307 markMany(refs);
2308 return changed;
2309 }
2310
2311 /**
2312 * Park refs as status='failed' by row id — the precise counterpart of

Callers 3

resolveAndPersistMethod · 0.80

Calls 4

referenceNameTailFunction · 0.85
prepareMethod · 0.65
transactionMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected