* 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 }>)
| 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 |
no test coverage detected