Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty "orders" field when "best_orders" is called at launch #2228

Open
naezith opened this issue Sep 25, 2024 · 1 comment
Open

Empty "orders" field when "best_orders" is called at launch #2228

naezith opened this issue Sep 25, 2024 · 1 comment
Labels
bug: orders priority: medium Moderately important tasks that should be completed but are not urgent.

Comments

@naezith
Copy link

naezith commented Sep 25, 2024

We need to parse the URL parameters at the web project to fill out the swap forms. The target/buy coin is selected as an order on the Taker form. That requires a best_orders call with the sell coin.

"coin": "LTC",
"action": "sell",
"request_by": {
    "type": "number",
    "value": 1
}

It's called immediately at launch (mm2 status being 3, rpcIsUp), orders field in the response is empty:

image

I solved the frontend issue by polling KMD orders a few times until it gives a proper response, then initiating the parsing. So this is not urgent at all. I am opening this issue just to note it.

macOS Chrome Web build (wasm)
main 35e9239

@onur-ozkan onur-ozkan added the bug label Sep 25, 2024
@mariocynicys
Copy link
Collaborator

This happens when no peer responds to our request

if response_tx.send(None).is_err() {

We are probably not yet connected via the p2p network yet.

An error could be returned here instead of just returning an empty orders list:

if let Some((p2p_response, peer_id)) = best_orders_res {

This will still require polling kdf while at startup but that's better than kdf polling the p2p network internally and hanging the RPC request.

@shamardy shamardy added the priority: medium Moderately important tasks that should be completed but are not urgent. label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: orders priority: medium Moderately important tasks that should be completed but are not urgent.
Projects
None yet
Development

No branches or pull requests

4 participants