wealthfolio icon indicating copy to clipboard operation
wealthfolio copied to clipboard

"Update portfolio" fail after import of action from Trading212

Open chappyDevv opened this issue 7 months ago • 3 comments

I have imported bunch of activities from Trading212 (3 years). Then the portfolio value and chart is not calculated with this error: [2025-05-04][06:46:04][webview:onError@tauri://localhost/assets/index-DXN2InWB.js:42:5706][ERROR] Error calculating historical data: Database operation failed: Database query failed: NOT NULL constraint failed: portfolio_history.book_cost

chappyDevv avatar May 04 '25 06:05 chappyDevv

Ah yes I've had this error also a couple of times during dev work.

For reference I was working with cryptocurrencies. The issue there was that I was casting a BigDecimal to f64 datatype. In my case I had to many decimals that could not be converted to f64. For some reason the book_cost is set to NULL or NAN.

I expect something simular happend here. We'll probably need to refactor the way the book_cost is calculated a bit to prevent this from happening in the future!

SvenHockers avatar May 18 '25 12:05 SvenHockers

Can you please check if you still have the issue after updating to v1.1.1.

afadil avatar May 19 '25 19:05 afadil

Yes and no. The error is not there any more, but but the Dashboard shows "0$". It is the same issue as https://github.com/afadil/wealthfolio/issues/256

chappyDevv avatar May 22 '25 20:05 chappyDevv