You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(checkout): make split checks atomic and allocation-safe #253
Split-check creation validates source state outside the transaction and uses proportional rounding that can produce an invalid negative remainder for small totals.
Current behavior
main/routes/bills.ts:263-339 reads and validates the source bill before withTxn.
Concurrent split requests can both pass validation and create multiple split groups.
The final check receives totalMinor - used; rounded allocations can make this negative.
void_adjustment rows are not excluded from item allocation.
Expected behavior
A split operation should be atomic, repeat-safe, and allocate non-negative integer minor-unit amounts whose sums reconcile exactly.
Acceptance criteria
Move source-state validation and allocation reads into the transaction.
Allow only one split group per source order/bill.
Use a largest-remainder or equivalent integer-minor-unit allocation algorithm.
Reject or exclude invalid/void-adjustment rows.
Add concurrent split, one-cent total, and voided-item regression tests.
Verification before implementation found this issue partially confirmed.
The negative-remainder allocation bug and void_adjustment exposure were reproduced. Mutable split-state validation was also moved fully into the transaction as structural hardening. The claimed duplicate split-group race was not reproduced in the current synchronous runtime: concurrent HTTP requests serialize and the duplicate request receives 409. PR #269 addresses the confirmed defects and adds regression coverage.
Activity
khaira777 commentedon Aug 12, 2026
Verification before implementation found this issue partially confirmed.
The negative-remainder allocation bug and void_adjustment exposure were reproduced. Mutable split-state validation was also moved fully into the transaction as structural hardening. The claimed duplicate split-group race was not reproduced in the current synchronous runtime: concurrent HTTP requests serialize and the duplicate request receives 409. PR #269 addresses the confirmed defects and adds regression coverage.
fix(bills): harden split-check transaction and minor unit allocation (F…
fix(bills): preserve split-check tax attribution (FreeOpenSourcePOS#295)