Something that I didn’t mention is that users can schedule invoices, and they’ll be at specific times like 12 o’clock. Invoices can also be recurring (like a subscription) which just increases the odds of more than 1 invoices coinciding at the same time.
You can see how this becomes a problem as more users use this feature and the number of users increases in the app. Currently I’m at a point where about 1 out of 3 invoices have duplicate ID’s because they coincide at the exact same time