A user wrote in to tell us that when they compared one of their Stripe invoices against what they could see in the dashboard (i.e. https://fly.io/dashboard/<org id>/billing/invoices/<stripe invoice id>), the lines had conflicting amounts, and they were confused about which was correct.
This was ultimately due to some stale code we added to our invoice UI during the Region-specific Machines pricing roll-out, in order to show users the difference between what they were being charged, and what they’d end up being charged once the roll-out was completed.
That code used hard-coded pricing, and so when we ended up changing CPU/RAM pricing this October, those hard-coded prices were out of date.
Now that we have no need to do any calculation in order to present the invoice, we’ve stripped this code out. In the future, if we ever need to do calculation, we’ll plan to query our pricing engine and cache the results, so this bug can’t happen again.
All current and historical invoices should be fixed - the invoice UI is just a projection of invoice data, so fixing the UI bug fixes display for all invoices.
Additionally, we noticed we were truncating amounts rather than rounding (as Stripe does), so lines/totals could be different in Stripe/our dashboard UI by a single cent. We were always truncating right before displaying, so the truncation never caused a deviation greater than one cent. This truncation behaviour also affected the Cost Explorer.
A disclaimer, to calm nerves: these were always display bugs. What Stripe charges is always the correct amount, having been calculated by our pricing engine and then handed to Stripe for payment processing.