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

ui: page refresh is needed when logging in during network outage #2269

Open
norwnd opened this issue Mar 29, 2023 · 2 comments
Open

ui: page refresh is needed when logging in during network outage #2269

norwnd opened this issue Mar 29, 2023 · 2 comments

Comments

@norwnd
Copy link
Contributor

norwnd commented Mar 29, 2023

If I log in while my network is down (wifi off) I see depth chart & candles loading animation that doesn't resolve to anything after network is back up (wifi on) until I refresh the page (even though dexc recovers from this outage just fine)

image

There is unmarket message in the logs right after login, but no loadmarket messages on that WS connection:

2023-03-29 06:01:37.604 [INF] DEXC: dexc version 0.6.0-pre+e47a6af4f (Go version go1.20.1)
2023-03-29 06:01:37.604 [INF] DEXC: Logging with UTC time stamps. Current local time is 09:01:37 MSK
2023-03-29 06:01:37.604 [INF] DEXC: dexc starting for network: mainnet
2023-03-29 06:01:37.604 [INF] DEXC: Swap locktimes config: maker 20h0m0s, taker 8h0m0s
2023-03-29 06:01:37.643 [INF] CORE[DB]: Started database (version = 6, file = /Users/norwnd/d-e-x-c-db/db_mainnet)
2023-03-29 06:01:37.643 [DBG] CORE: Using locale printer for "en-US"
2023-03-29 06:01:37.643 [DBG] CORE: new client core created
2023-03-29 06:01:37.643 [INF] CORE: Starting DEX client core
2023-03-29 06:01:37.645 [ERR] CORE[wss://dex.decred.org:7232/ws]: Initial connection failed, starting reconnect loop: dial tcp: lookup dex.decred.org: no such host
2023-03-29 06:01:37.645 [ERR] CORE: Trouble establishing connection to dex.decred.org:7232 (will retry). Error: dial tcp: lookup dex.decred.org: no such host
2023-03-29 06:01:37.645 [INF] CORE: Connected to 1 of 1 DEX servers
2023-03-29 06:01:37.645 [INF] CORE: Loaded 0 active orders.
2023-03-29 06:01:37.645 [INF] CORE: Loaded 0 active match orders
2023-03-29 06:01:37.645 [DBG] CORE: starting fiat rate fetching
2023-03-29 06:01:37.645 [DBG] WEB: Using embedded site resources.
2023-03-29 06:01:37.645 [INF] WEB: Using language en-US
2023-03-29 06:01:37.645 [INF] WEB: Using embedded HTML templates
2023-03-29 06:01:37.660 [INF] WEB: Web server listening on 127.0.0.1:5758

	****  OPEN IN YOUR BROWSER TO LOGIN AND TRADE  --->  http://127.0.0.1:5758  ****

2023-03-29 06:01:40.220 [TRC] WEB: "GET http://127.0.0.1:5758/markets HTTP/1.1" from 127.0.0.1:63916 - 303 33B in 95.489µs
2023-03-29 06:01:40.227 [TRC] WEB: "GET http://127.0.0.1:5758/login HTTP/1.1" from 127.0.0.1:63916 - 200 4643B in 495.651µs
2023-03-29 06:01:40.280 [TRC] WEB: "GET http://127.0.0.1:5758/css/style.css?v=YYNQOy0 HTTP/1.1" from 127.0.0.1:63916 - 200 167916B in 332.883µs
2023-03-29 06:01:40.281 [TRC] WEB: "GET http://127.0.0.1:5758/js/entry.js?v=YDDDOy0 HTTP/1.1" from 127.0.0.1:63917 - 200 335377B in 694.226µs
2023-03-29 06:01:40.359 [TRC] WEB: "GET http://127.0.0.1:5758/img/softened-icon.png HTTP/1.1" from 127.0.0.1:63917 - 200 4318B in 2.843141ms
2023-03-29 06:01:40.407 [TRC] WEB: "GET http://127.0.0.1:5758/api/user HTTP/1.1" from 127.0.0.1:63917 - 401 29B in 39.918µs
2023-03-29 06:01:40.466 [TRC] WEB: "GET http://127.0.0.1:5758/js/entry.js.map HTTP/1.1" from 127.0.0.1:63918 - 200 878977B in 1.093215ms
2023-03-29 06:01:40.487 [TRC] WEB: "GET http://127.0.0.1:5758/ws HTTP/1.1" from 127.0.0.1:63919 - 000 0B in 120.963µs
2023-03-29 06:01:40.487 [DBG] WEB[WS]: New websocket client 127.0.0.1:63919
2023-03-29 06:01:40.487 [TRC] WEB[WS][127.0.0.1:63919]: Starting websocket messaging with peer 127.0.0.1:63919
2023-03-29 06:01:40.607 [TRC] WEB: "GET http://127.0.0.1:5758/js/entry.js.map HTTP/1.1" from 127.0.0.1:63918 - 200 878977B in 380.147µs
2023-03-29 06:01:42.097 [TRC] CORE: notify: |DATA| (login) Verifying credentials...
2023-03-29 06:01:42.163 [TRC] CORE: notify: |DATA| (login) Connecting wallets...
2023-03-29 06:01:42.163 [TRC] CORE: notify: |DATA| (login) Resuming active trades...
2023-03-29 06:01:42.163 [INF] CORE: Loaded 0 active orders.
2023-03-29 06:01:42.163 [INF] CORE: Loaded 0 active match orders
2023-03-29 06:01:42.163 [INF] CORE: Loaded 0 incomplete orders with DEX dex.decred.org:7232
2023-03-29 06:01:42.163 [TRC] CORE: notify: |DATA| (login) Connecting to DEX servers...
2023-03-29 06:01:42.206 [TRC] WEB: "POST http://127.0.0.1:5758/api/login HTTP/1.1" from 127.0.0.1:63917 - 200 292B in 109.084797ms
2023-03-29 06:01:42.219 [TRC] WEB: "GET http://127.0.0.1:5758/api/user HTTP/1.1" from 127.0.0.1:63917 - 200 46675B in 842.35µs
2023-03-29 06:01:42.318 [TRC] WEB: "GET http://127.0.0.1:5758/markets HTTP/1.1" from 127.0.0.1:63917 - 200 49368B in 910.315µs
2023-03-29 06:01:42.646 [INF] CORE[wss://dex.decred.org:7232/ws]: Attempting to reconnect to wss://dex.decred.org:7232/ws...
2023-03-29 06:01:42.647 [ERR] CORE[wss://dex.decred.org:7232/ws]: Reconnect failed. Scheduling reconnect to wss://dex.decred.org:7232/ws in 5.0 seconds.
2023-03-29 06:01:47.648 [INF] CORE[wss://dex.decred.org:7232/ws]: Attempting to reconnect to wss://dex.decred.org:7232/ws...
2023-03-29 06:01:48.638 [DBG] CORE: notify: |POKE| (conn) Server connected - dex.decred.org:7232 is connected
2023-03-29 06:01:48.638 [INF] CORE[wss://dex.decred.org:7232/ws]: Successfully reconnected.
2023-03-29 06:01:48.645 [TRC] WEB: "GET http://127.0.0.1:5758/api/user HTTP/1.1" from 127.0.0.1:63917 - 200 46675B in 294.874µs
2023-03-29 06:01:48.657 [TRC] WEB: "GET http://127.0.0.1:5758/markets HTTP/1.1" from 127.0.0.1:63917 - 200 49368B in 198.382µs
2023-03-29 06:01:48.676 [TRC] WEB[WS]: message of type 1 received for route unmarket
2023-03-29 06:01:48.977 [INF] CORE: Server dex.decred.org:7232 supports API version 0.
2023-03-29 06:01:48.977 [DBG] CORE: Server dex.decred.org:7232 broadcast timeout 22m0s. Tick interval 2m45s
2023-03-29 06:02:06.738 [TRC] WEB[WS][127.0.0.1:63919]: Sent 11 and dropped 0 messages to 127.0.0.1:63919 before shutdown.
2023-03-29 06:02:06.738 [TRC] WEB[WS]: Disconnected websocket client 127.0.0.1:63919

I refreshed page there ^ to disconnect this stuck WS and reconnect, which resolves the issue, but ideally UI should resolve it automatically.

@norwnd
Copy link
Contributor Author

norwnd commented Mar 29, 2023

There is also this error in console, but looks like it is just about failure to handle SpotsUpdate notification due to this.market being uninitialised

image

@buck54321
Copy link
Member

There is also this error in console, but looks like it is just about failure to handle SpotsUpdate notification due to this.market being uninitialised

This part is resolved by #2286.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants