fix: preserve simplified settlement plans while payments are recorded #8
No reviewers
Labels
No labels
Enhancement
Bug
Feature
Performance
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
exler/spendbee!8
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/stable-settlement-plan"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Preserve the simplified repayment route as suggested payments are recorded. Full payments remove only their transfer; partial payments reduce only that transfer. Reloads and other members see the same persisted plan.
Previously, recording Bartek → Kacper 196.71 PLN rebuilt the greedy route, rerouting Wojtek and Pawel and increasing the eventual transfer count. The regression reproduces the original seven-person balances.
Implementation
Verification
uv run pytest tests/test_settlement_plan.py tests/test_settlement_method.py tests/test_expenses.py -q— 108 passed.uv run pytest -q— 362 passed, browser tests included, none skipped.git diff --checkand SQLite migration SQL.Migration and risks
Migration only creates a new table, without altering expenses/payments. Lazy initialization, no backfill. Balance reads take a short IMMEDIATE SQLite transaction (existing configured mode); concurrency relies on serialization, with no dedicated concurrency test added. Off-route/overpaid/other-currency payments and changed balances intentionally rebuild the route. No UI or dependency changes. Not deployed to Birdie.
Final CI verification
Initial CI stopped at the committed-CSS gate: Tailwind interpreted the word
shrinkin a new Python docstring as a utility class. Reworded it toreducewith no behavioral change. Post-change settlement-plan regression suite: 17 passed. Bun is unavailable in the reviewer environment; the locked CSS build passed in CI.Final head
ad02e1e62f23127d64f724cad0555e151f065a12: test job passed in run 55, including CSS consistency, Django/migration checks and the full browser-inclusive test suite. Image publication is intentionally skipped on pull requests. Not merged or deployed.