Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed
* Improved error handling in SkeletonProcessingService to throw a meaningful IllegalArgumentException
when a payload node cannot be matched to a skeleton document ID, replacing an uninformative NullPointerException.
* Fixed `canMergeCompleteBundle` incorrectly returning `true` when attachment logs are empty, causing a blank patient record after large message GP2GP transfers.

## [3.1.3] - 2025-09-19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public boolean canMergeCompleteBundle(String conversationId) throws ValidationEx
}

var undeletedLogs = getUndeletedLogsForConversation(conversationId);

if (undeletedLogs.isEmpty()) {
return false;
}

return undeletedLogs.stream().allMatch(log -> log.getUploaded().equals(true));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,16 @@ public void When_AttachmentsPresent_Expect_AttachmentReferenceUpdated()
verify(nackAckPreparationService, never()).sendNackMessage(any(NACKReason.class), any(RCMRIN030000UKMessage.class), any());
}

@Test
public void When_AllAttachmentLogsDeleted_CanMergeCompleteBundle_Expect_ReturnFalse() throws JAXBException {
var emptyAttachmentLogs = new ArrayList<PatientAttachmentLog>();

when(patientAttachmentLogService.findAttachmentLogs(CONVERSATION_ID)).thenReturn(emptyAttachmentLogs);
var result = inboundMessageMergingService.canMergeCompleteBundle(CONVERSATION_ID);

assertFalse(result);
}


private ArrayList<PatientAttachmentLog> createPatientAttachmentList(Boolean isParentUploaded, Boolean isSkeleton) {
var patientAttachmentLogs = new ArrayList<PatientAttachmentLog>();
Expand Down
Loading