Commit f875d4e
committed
fix(knowledge): re-verify connectorId at the actual hard-delete, fix docsDeleted count
Cursor findings: expectedConnectorId was only checked on the pre-transaction
SELECT in hardDeleteDocumentBatch, not on the DELETE itself — the billing
lookups and KB locking in between are async and can span a concurrent
"delete connector, keep documents" request, so the delete (and its embedding
cleanup) now re-verifies against a fresh in-transaction snapshot instead of
the stale existingIds. Also fixed docsDeleted to use hardDeleteDocuments'
actual returned count instead of the pre-filter candidate count, so a sync
log no longer overreports deletions that expectedConnectorId skipped.
/cleanup: dropped two comments that only restated the line below them.1 parent 283a789 commit f875d4e
2 files changed
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
1068 | | - | |
1069 | | - | |
| 1068 | + | |
1070 | 1069 | | |
1071 | 1070 | | |
1072 | | - | |
1073 | 1071 | | |
1074 | 1072 | | |
1075 | 1073 | | |
| |||
1489 | 1487 | | |
1490 | 1488 | | |
1491 | 1489 | | |
1492 | | - | |
1493 | 1490 | | |
1494 | 1491 | | |
1495 | 1492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2451 | 2451 | | |
2452 | 2452 | | |
2453 | 2453 | | |
2454 | | - | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
2455 | 2476 | | |
2456 | 2477 | | |
2457 | | - | |
| 2478 | + | |
2458 | 2479 | | |
2459 | 2480 | | |
2460 | 2481 | | |
| |||
0 commit comments