Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.3.0
-
Component/s: None
-
Labels:None
Description
This issue is a race condition possible when one of the following is true:
- The cron's deliver invoices task is run multiple times simultaneously (this shouldn't occur during normal operation since a task cannot be run if it's already running)
- The cron's deliver invoices task is run at the same time that someone manually sends an invoice for the company
- One or more persons manually sends multiple invoices simultaneously through separate actions (e.g. an admin sends invoices for one client while another admin sends different invoices for a different client)
In such cases, it's possible that between the time that the invoice PDF is generated and when it is sent, a new invoice PDF is generated for a different set of invoice(s) for the same company, which saves the file to disk with the same name at the same time.
- Update the filename saved on disk to be more unique to the invoice(s) being sent so one set of invoices being delivered cannot be overwritten by another