Imaging that! And I've over 1600 tests in the project, All have been useful at some point. But the over all lesson... inconsistantacys are obvious (some times) to a human; but never to the AI tool.
There on the left - 3 views of the (what I assume is the same data)... but obviously is NOT.
Market Value of $34878 is not even close to $7036 and not close to $26K either.
The common phrase for this issue is the ONE source of Truth. Do you remember the Highlander movie series - There can be ONLY ONE.
Nobody cares how many unit test your project has. They all amount to nothing if you have 3 values for the account value!
We can fix this problem - we just add another unit test ... this time failing because there are 3 unequal values. Nice - a failing test - red, green, refactor...
1599 unit test on the wall, take one down, run it around, 1598 unit tests on the wall.
Wish I had a beer for each of those unit tests!
David, I’d treat this as two separate problems, and I’ve fixed both.
The real bug was that the SQLite reload path was computing account.totalValue as equity + cash + revenue, but computing currentMarketValue as only equity + cash. That meant the Accounts card and the chart could legitimately diverge after a reload. I fixed that in SQLitePortfolioGraphLoader.swift, and added a regression test in SQLitePortfolioGraph_Tests.swift to lock it down.
The third number on the account detail screen was also misleading rather than wrong: that header was showing only active holdings equity while labeling it like the whole account market value. I changed the label to Equity Val. in ActiveHoldings_AccountSummary_Component.swift, so it’s clear that section is holdings-only and not the account total.
I verified with xcodebuild test on the DB_IntegrationTests scheme for the YellowBird-Sim iOS 26.4.1 simulator; the suite passed with 125 tests.
3 files changed!