Skip to content

fix(#1401): add validation to prevent invalid sample metadata registr…#1402

Draft
KochTobi wants to merge 1 commit intodevelopmentfrom
fix/issue-1401-sample-validation
Draft

fix(#1401): add validation to prevent invalid sample metadata registr…#1402
KochTobi wants to merge 1 commit intodevelopmentfrom
fix/issue-1401-sample-validation

Conversation

@KochTobi
Copy link
Contributor

…ation

Users could register invalid sample metadata by clicking confirm despite validation errors being displayed. This fix adds validation checks in EditSampleBatchDialog.onConfirmClicked() to ensure sample metadata was successfully uploaded and validated before allowing registration.

Changes:

  • Make uploadWithDisplay an instance field (was local variable) to allow state checking in onConfirmClicked()
  • Add validation logic to reject registration when:
    • No file was uploaded AND no validated metadata exists
    • File was uploaded BUT no validated metadata exists (validation failed)
  • Add test helper methods for improved testability:
    • getValidatedSampleMetadata()
    • getUploadWithDisplay()
    • setValidatedSampleMetadataForTest()

Testing:

  • Added comprehensive unit tests (EditSampleBatchDialogSpec.groovy)
  • 14 test cases covering all validation paths and edge cases
  • Complete test plan with 7 manual integration test cases
  • 16-item regression testing checklist

Documentation:

  • HANDOVER_ISSUE_1401.md: Comprehensive technical analysis
  • TEST_PLAN_ISSUE_1401.md: Testing procedures and checklist
  • IMPLEMENTATION_SUMMARY_ISSUE_1401.md: Change summary
  • IMPLEMENTATION_STATUS.md: Project status and verification

Impact:

  • No breaking changes to API contracts
  • Fully backward compatible with event listeners
  • Data integrity is now protected from invalid metadata registration

Fixes: #1401

…ation

Users could register invalid sample metadata by clicking confirm despite
validation errors being displayed. This fix adds validation checks in
EditSampleBatchDialog.onConfirmClicked() to ensure sample metadata was
successfully uploaded and validated before allowing registration.

Changes:
- Make uploadWithDisplay an instance field (was local variable) to allow
  state checking in onConfirmClicked()
- Add validation logic to reject registration when:
  * No file was uploaded AND no validated metadata exists
  * File was uploaded BUT no validated metadata exists (validation failed)
- Add test helper methods for improved testability:
  * getValidatedSampleMetadata()
  * getUploadWithDisplay()
  * setValidatedSampleMetadataForTest()

Testing:
- Added comprehensive unit tests (EditSampleBatchDialogSpec.groovy)
- 14 test cases covering all validation paths and edge cases
- Complete test plan with 7 manual integration test cases
- 16-item regression testing checklist

Documentation:
- HANDOVER_ISSUE_1401.md: Comprehensive technical analysis
- TEST_PLAN_ISSUE_1401.md: Testing procedures and checklist
- IMPLEMENTATION_SUMMARY_ISSUE_1401.md: Change summary
- IMPLEMENTATION_STATUS.md: Project status and verification

Impact:
- No breaking changes to API contracts
- Fully backward compatible with event listeners
- Data integrity is now protected from invalid metadata registration

Fixes: #1401
@github-actions github-actions bot added the fix label Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants