Skip to content

NIAD-3467 Fixed undeleted logs bug#1285

Closed
chiaramapellimt wants to merge 1 commit into
mainfrom
NIAD-3467-2
Closed

NIAD-3467 Fixed undeleted logs bug#1285
chiaramapellimt wants to merge 1 commit into
mainfrom
NIAD-3467-2

Conversation

@chiaramapellimt
Copy link
Copy Markdown
Contributor

@chiaramapellimt chiaramapellimt commented Jun 3, 2026

What

Add an empty list guard to canMergeCompleteBundle in InboundMessageMergingService to prevent premature bundle building when all attachment logs have been deleted.

Why

When the last attachment chunk of a large GP2GP patient record transfer arrives, checkAndMergeFileParts merges the fragments and then deletes their logs from the DB as cleanup. Immediately after, canMergeCompleteBundle checks those same logs to decide if the bundle is ready to build but they've just been deleted, so the list is empty. Java's allMatch() on an empty list always returns true, so the bundle gets built too early with no attachments.

The result is a blank patient record in Medicus after the transfer which is ofc wrong.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Internal change (non-breaking change with no effect on the functionality affecting end users)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the Changelog with details of my change in the UNRELEASED section if this change will affect end users
  • A corresponding change has been made to the Mapping Documentation repository

@chiaramapellimt chiaramapellimt requested a review from a team as a code owner June 3, 2026 13:29
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Images built and published to ECR using a Build Id of PR-1132-2e89c01

Bump actions/upload-artifact from 6.0.0 to 7.0.1 (#1281)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@b7c566a...043fb46)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ORybak5 <12736698+ORybak5@users.noreply.github.com>

NIAD-3467 Fixed undeleted logs bug
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Looks good. All 3 mutations in this change were killed.

class surviving killed
💯uk.nhs.adaptors.pss.translator.service.InboundMessageMergingService 0 3

See https://pitest.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants