status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
296 stars 79 forks source link

Swap to show conversion rate even if the user does not have enough funds #16599

Open virginiabalducci opened 1 week ago

virginiabalducci commented 1 week ago

Bug Report

Description

Swap to show conversion rate even if the user does not have enough funds

Steps to reproduce

You can use an account that has funds or no funds at all

  1. Go to wallet and click on Swap
  2. Put a high amount on the Pay side (an amount greater than what the user actually have for that specific token)

Expected behavior

The Receive end should show the conversion rate even if there are not enough funds

Actual behavior

The Receive end does not show any conversion rate

Image

Additional Information

dlipicar commented 3 days ago

Image

@virginiabalducci cannot reproduce on latest release branch, could you re-check?

One issue we have is that the "no balance" error "hides" other errors. So perhaps you had some additional problem not letting you fetch the paraswap route properly, but the "no balance" error didn't let you see it...

virginiabalducci commented 3 days ago

Hi @dlipicar thanks for checking! This issue is still broken on an older version of the release branch from last week, but on a newer version today, this issue is no longer reproducible: StatusIm-Desktop-v2.31.0-rc.1-9e5a17-x86_64.dmg

Attaching some info from the version that is broken, in case this is relevant but either way if this is no longer reproducible in the latest release version we can close this issue. I'll wait for your confirmation!

https://github.com/user-attachments/assets/d9d30003-581e-4575-8339-0847c4201230

app_20241028_151853.log

DBG 2024-10-28 18:43:05.514Z [threadpool task thread] initiating task   topics="task-threadpool" tid=77380809 file=threadpool.nim:56 messageType=BuildTokensTaskArg:ObjectType threadid=77380809 task="{\"$type\":\"BuildTokensTaskArg:ObjectType\",\"accounts\":[\"0xf03696efffca47bc9fc7e9984248e1270e904620\",\"0x21934ee1626e6fc30af951db1184c687904763aa\",\"0xbf3df1d40ef9b4b76207b63429094d23f66a4289\",\"0xb751ab5530174d84526971b903fd5ce588d5e3dc\"],\"storeResult\":true,\"vptr\":105553128352000,\"slot\":\"onAllTokensBuilt\"}"
DBG 2024-10-28 18:43:05.514Z NewBE_callPrivateRPC                       topics="rpc" tid=77380809 file=core.nim:27 rpc_method=wallet_fetchOrGetCachedWalletBalances
WRN 2024-10-28 18:43:06.602Z qt warning                                 topics="qt" tid=77380793 text="qrc:/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml:71: TypeError: Cannot read property 'amount' of undefined \n                     expression: model.currencyBalance.amount" file=:0 category=default
DBG 2024-10-28 18:43:06.753Z [threadpool task thread] initiating task   topics="task-threadpool" tid=77380810 file=threadpool.nim:56 messageType=AsyncAddCentralizedMetricIfEnabledTaskArg:ObjectType threadid=77380810 task="{\"$type\":\"AsyncAddCentralizedMetricIfEnabledTaskArg:ObjectType\",\"eventName\":\"swap\",\"eventValueJson\":\"{\\\"subEvent\\\":\\\"popup opened\\\"}\",\"vptr\":105553128351200,\"slot\":\"onCentralizedMetricAddedIdEnabled\"}"
WRN 2024-10-28 18:43:23.217Z qt warning                                 topics="qt" tid=77380793 text="QML Loader: Binding loop detected for property \"active\"" file=qrc:/imports/shared/controls/InformationTag.qml:87 category=default
WRN 2024-10-28 18:43:23.241Z qt warning                                 topics="qt" tid=77380793 text="Qt Quick Layouts: Polish loop detected. Aborting after two iterations." file=:0 category=default
DBG 2024-10-28 18:43:24.218Z NewBE_callPrivateRPC                       topics="rpc" tid=77380793 file=core.nim:27 rpc_method=wallet_getSuggestedRoutesAsync
DBG 2024-10-28 18:43:24.899Z [threadpool task thread] initiating task   topics="task-threadpool" tid=77380806 file=threadpool.nim:56 messageType=BuildTokensTaskArg:ObjectType threadid=77380806 task="{\"$type\":\"BuildTokensTaskArg:ObjectType\",\"accounts\":[\"0xf03696efffca47bc9fc7e9984248e1270e904620\",\"0x21934ee1626e6fc30af951db1184c687904763aa\",\"0xbf3df1d40ef9b4b76207b63429094d23f66a4289\",\"0xb751ab5530174d84526971b903fd5ce588d5e3dc\"],\"storeResult\":true,\"vptr\":105553128352000,\"slot\":\"onAllTokensBuilt\"}"
DBG 2024-10-28 18:43:24.899Z NewBE_callPrivateRPC                       topics="rpc" tid=77380806 file=core.nim:27 rpc_method=wallet_fetchOrGetCachedWalletBalances
WRN 2024-10-28 18:43:49.423Z qt warning                                 topics="qt" tid=77380793 text="QML Loader: Binding loop detected for property \"active\"" file=qrc:/imports/shared/controls/InformationTag.qml:87 category=default
WRN 2024-10-28 18:43:49.440Z qt warning                                 topics="qt" tid=77380793 text="Qt Quick Layouts: Polish loop detected. Aborting after two iterations." file=:0 category=default
DBG 2024-10-28 18:43:50.421Z NewBE_callPrivateRPC                       topics="rpc" tid=77380793 file=core.nim:27 rpc_method=wallet_getSuggestedRoutesAsync
DBG 2024-10-28 18:43:51.482Z [threadpool task thread] initiating task   topics="task-threadpool" tid=77380805 file=threadpool.nim:56 messageType=BuildTokensTaskArg:ObjectType threadid=77380805 task="{\"$type\":\"BuildTokensTaskArg:ObjectType\",\"accounts\":[\"0xf03696efffca47bc9fc7e9984248e1270e904620\",\"0x21934ee1626e6fc30af951db1184c687904763aa\",\"0xbf3df1d40ef9b4b76207b63429094d23f66a4289\",\"0xb751ab5530174d84526971b903fd5ce588d5e3dc\"],\"storeResult\":true,\"vptr\":105553128352000,\"slot\":\"onAllTokensBuilt\"}"
DBG 2024-10-28 18:43:51.482Z NewBE_callPrivateRPC                       topics="rpc" tid=77380805 file=core.nim:27 rpc_method=wallet_fetchOrGetCachedWalletBalances
dlipicar commented 2 days ago

@virginiabalducci ugh that's weird... I don't see changes directly affecting this since the first RC. Let me run a couple of tests more to make sure it's not an intermittent issue. Please ping me if you see this in the current release branch.

virginiabalducci commented 23 hours ago

Hey @dlipicar I see this issue reproducing on 2.31 RC-2

dlipicar commented 23 hours ago

@virginiabalducci could you share geth.log?

virginiabalducci commented 23 hours ago

It was reproduced constantly yesterday on 2.31 rc-2 but today I am only reproducing it on 1 account:

Reproducible on geth.log account test50.zip

https://github.com/user-attachments/assets/457b2691-5451-45ab-b59f-743e90ccf967

Not reproducible on geth.log.zip

yesterday it was not working on this same account, attaching an older get.log geth2.log.zip

anastasiyaig commented 21 hours ago

lets move it to 2.32