safeCount swallowed every exception from countDocumentsForTable without logging, and its null fallback was then written to documentCount, erasing the last good count.
ReconcileIndexStep.safeCount now logs a WARN with the exception and logPair("tableName", ...) before returning null.
BasepullIndexStep had an exact copy of it; that copy is removed and the step calls ReconcileIndexStep.safeCount, as FullReindexStep already did.
All three callers (basepull, reconcile, full reindex) skip documentCount when the count is null, so the row keeps its previous value. The rest of the run is unchanged.
Testing
New unit tests in BasepullIndexStepTest, ReconcileIndexStepTest and FullReindexStepTest seed a stale documentCount of 99, make the count throw, capture ReconcileIndexStep's logger with QLogger.activateCollectingLoggerForClass, and assert exactly one WARN line carrying the table name and the stack trace, a completed run, and documentCount still 99. They fail against the previous code.
CI=true ./mvnw verify: 310 unit tests and 18 integration tests pass, JaCoCo coverage checks met.
## Summary
`safeCount` swallowed every exception from `countDocumentsForTable` without logging, and its `null` fallback was then written to `documentCount`, erasing the last good count.
- `ReconcileIndexStep.safeCount` now logs a WARN with the exception and `logPair("tableName", ...)` before returning `null`.
- `BasepullIndexStep` had an exact copy of it; that copy is removed and the step calls `ReconcileIndexStep.safeCount`, as `FullReindexStep` already did.
- All three callers (basepull, reconcile, full reindex) skip `documentCount` when the count is `null`, so the row keeps its previous value. The rest of the run is unchanged.
## Testing
- New unit tests in `BasepullIndexStepTest`, `ReconcileIndexStepTest` and `FullReindexStepTest` seed a stale `documentCount` of 99, make the count throw, capture `ReconcileIndexStep`'s logger with `QLogger.activateCollectingLoggerForClass`, and assert exactly one WARN line carrying the table name and the stack trace, a completed run, and `documentCount` still 99. They fail against the previous code.
- `CI=true ./mvnw verify`: 310 unit tests and 18 integration tests pass, JaCoCo coverage checks met.
Closes #17
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
safeCountswallowed every exception fromcountDocumentsForTablewithout logging, and itsnullfallback was then written todocumentCount, erasing the last good count.ReconcileIndexStep.safeCountnow logs a WARN with the exception andlogPair("tableName", ...)before returningnull.BasepullIndexStephad an exact copy of it; that copy is removed and the step callsReconcileIndexStep.safeCount, asFullReindexStepalready did.documentCountwhen the count isnull, so the row keeps its previous value. The rest of the run is unchanged.Testing
BasepullIndexStepTest,ReconcileIndexStepTestandFullReindexStepTestseed a staledocumentCountof 99, make the count throw, captureReconcileIndexStep's logger withQLogger.activateCollectingLoggerForClass, and assert exactly one WARN line carrying the table name and the stack trace, a completed run, anddocumentCountstill 99. They fail against the previous code.CI=true ./mvnw verify: 310 unit tests and 18 integration tests pass, JaCoCo coverage checks met.Closes #17