Skip to content

S28-5068 Soft-delete original VF recordings where a re-encoded version exists#1516

Merged
lydiaralphgov merged 12 commits into
masterfrom
S28-5068/delete-original-vf-recordings
Jul 23, 2026
Merged

S28-5068 Soft-delete original VF recordings where a re-encoded version exists#1516
lydiaralphgov merged 12 commits into
masterfrom
S28-5068/delete-original-vf-recordings

Conversation

@lydiaralphgov

@lydiaralphgov lydiaralphgov commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

JIRA ticket(s)

Change description

  • New methods on recording service to delete / undelete vodafone original recordings where a re-encoded version exists for that capture session
  • No new API endpoint. Needs to be triggered via task.
  • New boolean flag on repositories DB table to mark recordings that were deleted after re-encodings were turned on.

Note: because this task needs to be run manually to update visibility, it will need to be re-run after any future re-encodes or if the flag is toggled.

Effect of this task after toggling the flag: original VF recordings will be marked as deleted and will therefore be invisible on the app.

Important

This PR requires manual testing by QA. Please notify the QA team @hmcts/pre-rec-evidence-qa.

QA instructions

Set up:

  • Create a Vodafone recording (VF1) on the database
  • Create a second recording (VF2): version 2, parent recording points to VF1, is_reencode set to true
  • Create another Vodafone recording (VF3) on the database

Test 1:

  • Set the flag to false (i.e. don't hide re-encoded recordings)
  • Run the uk.gov.hmcts.reform.preapi.tasks.UpdateRecordingsVisibility task
  • VF2 and VF3 should be visible
  • VF1 should be deleted (i.e. invisible)

Test 2:

  • Set the flag to true (i.e. hide re-encoded recordings)
  • Run the uk.gov.hmcts.reform.preapi.tasks.UpdateRecordingsVisibility task
  • VF1 and VF3 should be visible (not deleted)
  • VF2 should be invisible (also not deleted)

@lydiaralphgov
lydiaralphgov requested a review from a team as a code owner July 20, 2026 12:57
@lydiaralphgov

lydiaralphgov commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

To discuss at dev chat:

  • run task automatically on start up? ( a bit more dev effort)
  • run task periodically every N minutes to delete / undelete flags? (probably overkill, but will pick up any new re-encodes that are done)
  • run task manually when updating flag (easiest and least wasted effort, but relies on remembering to do it, and won't pick up any new re-encodes)

DECISION: run as manual task on adhoc basis

@oliver-scott

Copy link
Copy Markdown
Contributor

Looks good - but don't we also need to unhide the re-encoded recordings? Or is that being done in a separate PR?

Comment thread src/main/java/uk/gov/hmcts/reform/preapi/repositories/RecordingRepository.java Outdated

@RuthKirby RuthKirby left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, asked some clarifying comments

@lydiaralphgov

Copy link
Copy Markdown
Contributor Author

Looks good - but don't we also need to unhide the re-encoded recordings? Or is that being done in a separate PR?

@oliver-scott this is already controlled directly in code by the HIDE_REENCODED_RECORDINGS flag https://github.com/hmcts/pre-api/blob/master/src/main/java/uk/gov/hmcts/reform/preapi/security/AuthorisationService.java#L217-L220

RuthKirby
RuthKirby previously approved these changes Jul 22, 2026
@lydiaralphgov
lydiaralphgov merged commit 16e9428 into master Jul 23, 2026
7 checks passed
@lydiaralphgov
lydiaralphgov deleted the S28-5068/delete-original-vf-recordings branch July 23, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants