stackernews / stacker.news

Internet communities that pay you Bitcoin
https://stacker.news
MIT License
439 stars 113 forks source link

Wrong display down-zap amount sats #1576

Open Darth-Coin opened 2 weeks ago

Darth-Coin commented 2 weeks ago

Is there an existing issue for this?

Describe the bug

Not sure if you know about this, but I think there's a bug in displaying a downzapped post. The amount of sats you used for the downzap is displayed as total sats zapped to the post. This could mislead others and think that were sats for upvotes when in fact are more downvotes.

Screenshots

No response

Steps To Reproduce

Try to reproduce like this. If there's a post with already zapped 10 sats, go and downzap with same 10sats If you downzap with 10 sats, the flag it appear but the sats are added to total as it would be an upvote.

Expected behavior

I suggest to separate upvotes from downvotes or make a reduction of total sats displayed with the sats used to downvote.

Logs

No response

Device information

No response

Additional context

No response

ekzyis commented 2 weeks ago

Ohh, thank you, I also noticed this recently but forgot to create a ticket

ekzyis commented 2 weeks ago

Mhh, I have definitely seen the total sats increase too recently when I downzapped (and you creating this ticket now is probably not a coincidence) but I can't reproduce locally:

downzap with no sats from me yet https://github.com/user-attachments/assets/8f8697c8-bde2-48f7-99f8-05db82b1c951
combination of downzap + upzaps https://github.com/user-attachments/assets/1d655946-4a79-4057-a8f4-6293ea43d5c7
first zap, then downzap https://github.com/user-attachments/assets/a1b08fcf-5ec9-467e-aedb-7b9527cc7e17
using the flag to downzap again https://github.com/user-attachments/assets/981b2da0-c01b-4172-b274-b0f8143c5c9c
huumn commented 2 weeks ago

It's probably not your zaps that you're see update. It's likely the same cause as #1509

ekzyis commented 2 weeks ago

Mhh, shouldn't this reproduce it then?

https://github.com/user-attachments/assets/25f1b2f3-f262-4378-be64-a2918f758e3b

I tried paying with fee credits (this video) and attached wallets, both looked fine.

Darth-Coin commented 2 weeks ago

wow this is getting strange. I tried again today and is not behaving like that anymore. Is it possible that in the same time others will upvote with the same amount? That will be a damn coincidence. Will keep an eye on this trying to make tests with various amounts.

ekzyis commented 2 weeks ago

Is it possible that in the same time others will upvote with the same amount? That will be a damn coincidence.

Doesn't have to be at the same time, someone just has to zap the same amount between you loading the page and zapping something.

Will keep an eye on this trying to make tests with various amounts.

Cool, thanks, this will be valuable!