-
Notifications
You must be signed in to change notification settings - Fork 213
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
PDF_Filler temp files need to be unique #95644
Comments
Reverting the PR. |
This new PR: https://github.com/department-of-veterans-affairs/vets-api/pull/19143/files |
LGTM @stevelong00 |
The PR has all needed approvals and is ready to merge. @baltes, shall I proceed with the merge? |
@stevelong00 If it's behind a feature flag, we can merge. If not, we probably need testing steps to verify it in staging before it goes to prod. |
@baltes It's behind a feature flag and currently disabled in all environments. Merging now. |
@baltes This looks good in staging. |
"Due to the growing number of 7959F1 files, our temporary files with the same name can cause conflicts. This could lead to issues if two users try to save a file with the same 7959F1 name simultaneously."
If the files are named correctly, we won't see this error:
Error: An error occurred while verifying stamp: No such file or directory @ rb_file_s_rename
which is caused by conflicting naming, e.g. tmp/vha_10_7959f_1-stamped.pdf or tmp/vha_10_7959f_1.pdfOld AC: Each application 7959F1 file unique name, like use a SecureRandom.hex. example:
generated_form_path = Rails.root.join("tmp/#{name}-#{SecureRandom.hex}-tmp.pdf").to_s
stamped_template_path = Rails.root.join("tmp/#{name}-#{SecureRandom.hex}-stamped.pdf").to_s
New AC:
All temporary files must be uniquely named.
Need unit test to ensure that the output file for s3 is named correctly:
It should not be this format:
tmp/vha_10_7959f_1-cf1b6e07204447096d9bf37837c61df7.pdf
or this
tmp/vha_10_7959f_1-stamped.pdf
ortmp/vha_10_7959f_1.pdf
Correct format is: tmp/0099687f-7e9c-45a9-8865-ac67f0d7ef31_vha_10_7959f_1.pdf for PEGA to process the claims
The text was updated successfully, but these errors were encountered: