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

PDF_Filler temp files need to be unique #95644

Closed
cloudmagic80 opened this issue Oct 22, 2024 · 9 comments
Closed

PDF_Filler temp files need to be unique #95644

cloudmagic80 opened this issue Oct 22, 2024 · 9 comments

Comments

@cloudmagic80
Copy link
Contributor

cloudmagic80 commented Oct 22, 2024

"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.pdf

Old 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 thistmp/vha_10_7959f_1-stamped.pdfor tmp/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

@cloudmagic80 cloudmagic80 self-assigned this Oct 22, 2024
@baltes baltes added the sprint 3 planning ivc forms sprint 3 label Oct 23, 2024
@cloudmagic80
Copy link
Contributor Author

@cloudmagic80
Copy link
Contributor Author

Reverting the PR.

@cloudmagic80
Copy link
Contributor Author

@cloudmagic80
Copy link
Contributor Author

This new PR: https://github.com/department-of-veterans-affairs/vets-api/pull/19143/files
supersedes the other PRs that came before this one

@baltes baltes removed the sprint 3 planning ivc forms sprint 3 label Oct 30, 2024
@stevelong00 stevelong00 self-assigned this Oct 31, 2024
@cloudmagic80
Copy link
Contributor Author

LGTM @stevelong00

@baltes baltes added the sprint 3 planning ivc forms sprint 3 label Nov 6, 2024
@andrea-merrill andrea-merrill removed the sprint 3 planning ivc forms sprint 3 label Nov 6, 2024
@stevelong00
Copy link
Contributor

The PR has all needed approvals and is ready to merge. @baltes, shall I proceed with the merge?

@baltes
Copy link
Contributor

baltes commented Nov 12, 2024

@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.

@stevelong00
Copy link
Contributor

@baltes It's behind a feature flag and currently disabled in all environments. Merging now.

@cloudmagic80
Copy link
Contributor Author

@baltes This looks good in staging.
Screenshot 2024-11-13 at 1.44.57 PM.png

@baltes baltes closed this as completed Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants