XRPLF / xrpl-dev-portal

Source code for xrpl.org including developer documentation
https://xrpl.org
Other
512 stars 1k forks source link

WebSocket Tool hangs on large responses #2614

Open mDuo13 opened 3 weeks ago

mDuo13 commented 3 weeks ago

When you use the WebSocket tool and receive a large JSON response, the interface lags and seems to hang at some point without rendering the whole response document. This appears to be a problem in our use of CodeMirror or something related to it.

Example of a request that prompts a very large reponse: https://xrpl.org/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Fs1.ripple.com%2F&req=%7B%20%20%22id%22%3A%202%2C%0A%20%20%22command%22%3A%20%22account_tx%22%2C%0A%20%20%22account%22%3A%20%22rMARkETxZ2mVC7tVBeSimqkevY2ARW45kg%22%2C%0A%20%20%22ledger_index_min%22%3A%2088071543%2C%0A%20%20%22ledger_index_max%22%3A%2088081544%2C%0A%20%20%22binary%22%3A%20false%2C%0A%20%20%22limit%22%3A%20100%2C%0A%20%20%22forward%22%3A%20false%0A%7D

Possible solutions might involve changing how we use CodeMirror, or even not using CodeMirror for responses (esp. over a certain size). Further investigation is necessary to identify the cause and whether or not CodeMirror is indeed the bottleneck.

BTW, I was able to reproduce the problem on the old Dactyl-based version of the site, so it's not specifically a problem with React or Redocly.

AKCodez commented 3 weeks ago
image

Noticed a maximum call stack size exceeded error in the console as well as the page being very laggy, this must be related to some recursive function missing a base case. Have not looked at the code yet