hotfix: filter entities with empty value in redactionLog and entityLog

This commit is contained in:
Kilian Schuettler 2023-11-30 12:37:53 +01:00
parent 1ba3952e9b
commit e3726c7e26
2 changed files with 3 additions and 1 deletions

View File

@ -322,7 +322,7 @@ public class AnalyzeService {
RedactionLog previousRedactionLog = redactionStorageService.getRedactionLog(analyzeRequest.getDossierId(), analyzeRequest.getFileId());
previousRedactionLog.setRedactionLogEntry(previousRedactionLog.getRedactionLogEntry().stream().filter(entity -> !entity.getValue().isEmpty()).collect(Collectors.toList()));
redactionLog.setDictionaryVersion(dictionaryVersion.getDossierTemplateVersion());
redactionLog.setDossierDictionaryVersion(dictionaryVersion.getDossierVersion());

View File

@ -42,6 +42,8 @@ public class RedactionChangeLogService {
return new RedactionLogChanges(currentRedactionLog, false);
}
previousRedactionLog.setRedactionLogEntry(previousRedactionLog.getRedactionLogEntry().stream().filter(entity -> !entity.getValue().isEmpty()).collect(Collectors.toList())); // only needed for already broken files on staging.documine.ai
List<RedactionLogEntry> previouslyExistingEntries = previousRedactionLog.getRedactionLogEntry().stream().filter(entry -> !entry.lastChangeIsRemoved()).toList();
Map<String, RedactionLogEntry> addedEntryIds = getEntriesThatExistInCurrentButNotInPreviousRedactionLog(currentRedactionLog, previouslyExistingEntries);