Fix V2.8: selectedRows-Leerproblem und isRunning()-Inkonsistenz behoben
- markSelectedRowsAsResetPending() schützt selectedRows jetzt mit selectionSyncInProgress=true, sodass der TableView-SelectionModel- Listener die Selektion nicht löscht, wenn Zeilen ersetzt werden - isRunning() und updateButtonStates() verwenden runningProperty.get() statt coordinator.isRunning() für konsistentes Verhalten zwischen Button-Zustand und Selektion - Diagnose-LOG am Anfang von handleReprocessSelected() gibt isRunning() und selectedRows.size() aus (Laufend=false, Selektion>0 erwartet) - Alle [TEMP-TRACE]-Logs entfernt aus GuiBatchRunCoordinator, SqliteUnitOfWorkAdapter, SqliteDocumentRecordRepositoryAdapter und DocumentProcessingCoordinator Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
+4
-6
@@ -298,13 +298,11 @@ public final class GuiBatchRunCoordinator {
|
||||
// Reset the database status synchronously before starting the mini-run.
|
||||
// This ensures that documents are not skipped due to FAILED_FINAL or other
|
||||
// terminal states.
|
||||
LOG.info("[TEMP-TRACE] startReprocessing: Konfiguration={}, Fingerprints={}",
|
||||
configFilePath, fingerprintFilter.stream()
|
||||
.map(f -> f.sha256Hex().substring(0, 8) + "…")
|
||||
.collect(java.util.stream.Collectors.joining(", ")));
|
||||
LOG.info("GUI-Erneut-Verarbeiten: Starte Status-Reset für {} Dokument(e), Konfiguration={}.",
|
||||
fingerprintFilter.size(), configFilePath);
|
||||
ResetDocumentStatusResult resetResult = resetPort.reset(configFilePath, fingerprintFilter);
|
||||
LOG.info("[TEMP-TRACE] startReprocessing: Reset-Ergebnis: {} erfolgreich, {} fehlgeschlagen; Fehler={}",
|
||||
resetResult.successCount(), resetResult.failureCount(), resetResult.failures());
|
||||
LOG.info("GUI-Erneut-Verarbeiten: Status-Reset abgeschlossen – {} erfolgreich, {} fehlgeschlagen.",
|
||||
resetResult.successCount(), resetResult.failureCount());
|
||||
if (resetResult.successCount() == 0) {
|
||||
LOG.warn("GUI-Reprocessing: Reset für alle {} Dokumente fehlgeschlagen; "
|
||||
+ "Mini-Lauf wird nicht gestartet.", fingerprintFilter.size());
|
||||
|
||||
+11
-4
@@ -285,7 +285,7 @@ public final class GuiBatchRunTab {
|
||||
* @return {@code true} while the coordinator is processing a run
|
||||
*/
|
||||
public boolean isRunning() {
|
||||
return coordinator.isRunning();
|
||||
return runningProperty.get();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -687,6 +687,8 @@ public final class GuiBatchRunTab {
|
||||
}
|
||||
|
||||
private void handleReprocessSelected() {
|
||||
LOG.info("GUI-Erneut-Verarbeiten: handleReprocessSelected aufgerufen. "
|
||||
+ "Laufend={}, Selektion={}.", isRunning(), selectedRows.size());
|
||||
if (isRunning() || selectedRows.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@@ -766,8 +768,13 @@ public final class GuiBatchRunTab {
|
||||
*/
|
||||
private void markSelectedRowsAsResetPending() {
|
||||
List<GuiBatchRunResultRow> toMark = new ArrayList<>(selectedRows);
|
||||
for (GuiBatchRunResultRow row : toMark) {
|
||||
upsertResultRowByFingerprint(GuiBatchRunResultRow.resetMarker(row));
|
||||
selectionSyncInProgress = true;
|
||||
try {
|
||||
for (GuiBatchRunResultRow row : toMark) {
|
||||
upsertResultRowByFingerprint(GuiBatchRunResultRow.resetMarker(row));
|
||||
}
|
||||
} finally {
|
||||
selectionSyncInProgress = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -822,7 +829,7 @@ public final class GuiBatchRunTab {
|
||||
}
|
||||
|
||||
private void updateButtonStates() {
|
||||
boolean running = coordinator.isRunning();
|
||||
boolean running = runningProperty.get();
|
||||
startButton.setDisable(running);
|
||||
if (!running) {
|
||||
cancelButton.setDisable(true);
|
||||
|
||||
Reference in New Issue
Block a user