Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mrf): attachment equality validation #7324

Merged
merged 1 commit into from
May 13, 2024
Merged

Conversation

justynoh
Copy link
Contributor

@justynoh justynoh commented May 13, 2024

Problem

Attachment equality validation had to be removed previously due to backward compatibility issues in v6.119.1. This PR restores it.

Solution

Inject a new md5Hash key in the database for attachment answers.

  • The key is populated with the attachment MD5 hash after virus scanning has been completed.
  • The incoming attachment's MD5 is compared with the existing attachment's MD5 in order to determine equality.

At the same time, I also made a change to the frontend mutation name that was bothering me. paiseh

Breaking Changes

  • No - this PR is backwards compatible

Tests

  • Create an MRF with two attachment fields. Respondent 1 can edit question 1. Respondent 2 can edit question 2.

Backward-compatibility tests

  • Submit an MRF with an attachment 1 on the old application version as respondent 1.
  • Now, submit the same form with an attachment 2 on the new application version as respondent 2. This should succeed.

Tests

  • Submit an MRF with an attachment 1 on the new application version as respondent 1.
  • Now, submit the same form with an attachment 2 on the new application version as respondent 2. This should succeed.

Copy link
Contributor

@kathleenkhy kathleenkhy left a comment

Choose a reason for hiding this comment

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

lgtm!

@justynoh justynoh merged commit 028ca2d into develop May 13, 2024
42 of 43 checks passed
@justynoh justynoh deleted the fix/attachment-validation branch May 13, 2024 06:06
@justynoh justynoh mentioned this pull request May 14, 2024
5 tasks
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