Sia-UI icon indicating copy to clipboard operation
Sia-UI copied to clipboard

Negative funds remaining

Open nepeat opened this issue 6 years ago • 7 comments

Bug

When the sum of the spending totals are more than the allowance, the UI glitches and displays negative SC remaining.

Client/Server Info

Client is on macOS 10.13.0 GM, commit NebulousLabs/Sia-UI@d3aca71 Server is on Ubuntu Server 16.04 LTS, commit NebulousLabs/Sia@f16b5eb

Screenshots

App UI of the glitch Zoomed crop for mobile -4.639999999999986 SC remaining

nepeat avatar Oct 22 '17 03:10 nepeat

Thanks for the detailed report! What's the desired behavior here? Seems like the amount spent shouldn't exceed the allowance in the first place, but I guess we shouldn't assume that will never happen. Maybe display 4.63 SC over allowance in red?

lukechampine avatar Oct 23 '17 04:10 lukechampine

I believe there is a bigger issue with the UI display in the first place since the info that it is giving is very different than what the CLI gives me.

I also was able to decrease my future allowance to 300 SC and well, the UI broke hard and couldn't display the allowance bar without rescaling the window.

Edit: Since GitHub sent my comment a little early, mind if I changed the bug title to "Allowance display problems when spending exceeds allowance"?

Renter info:
	Storage Spending:  118.3 SC
	Upload Spending:   3.697 SC
	Download Spending: 0 H
	Unspent Funds:     478.1 SC
	Total Allocated:   600.2 SC

Overflowing into menu icons

image

Contracts text cut off

image

Looks like it works, minus the SC remaining text

image

nepeat avatar Oct 23 '17 05:10 nepeat

Are you sure the UI is displaying different values than siac? They both pull from the renter's financialmetrics API endpoint, so they definitely should not be different. Thanks for the detailed report, there should be a pull request shortly to fix the sizing issues.

avahowell avatar Oct 23 '17 15:10 avahowell

Looks like the UI's unspent calculation was separate from the API. I was able to reproduce this issue, and #728 should resolve it.

avahowell avatar Oct 23 '17 16:10 avahowell

Just pulled the branch, bar width issue is fixed but the calculations still seem off. image

nepeat avatar Oct 23 '17 16:10 nepeat

What does the CLI give you?

avahowell avatar Oct 23 '17 16:10 avahowell

siac renter -v

Renter info:
	Storage Spending:  121 SC
	Upload Spending:   3.813 SC
	Download Spending: 0 H
	Unspent Funds:     475.4 SC
	Total Allocated:   600.2 SC

siac renter allowance

Allowance:
	Amount: 300 SC
	Period: 12096 blocks

nepeat avatar Oct 23 '17 16:10 nepeat