🗃 Github Issue Or Explanation for this PR. (What is it supposed to do and Why is needed)
Tested - this reconnect method works.
Can still be improved but at least it eventually reconnects
✅ Checklist
[ ] Github issue details are up to date for people to QA.
[x] I have tested all my changes.
🕵️♂️ Notes for Code Reviewer
There were a couple of different factors that made reconnecting difficult and not working:
The JavaScript engine times out only after 60 seconds when there's a disconnected network. Our alive check runs in 18 seconds so that's an issue
Restarting would totally hang with JS errors
JS errors were not propagated correctly - Syntax errors would be caused when the connection failed since there would be no "api" object to refer to. These would not be handled. Now they are handled correctly and the evaluate method returns null when there's a syntax error.
Restart was in the substrate service, but the substrate service object would be shut down and recreated. Moved to polkadot service.
🗃 Github Issue Or Explanation for this PR. (What is it supposed to do and Why is needed)
Tested - this reconnect method works.
Can still be improved but at least it eventually reconnects
✅ Checklist
🕵️♂️ Notes for Code Reviewer
There were a couple of different factors that made reconnecting difficult and not working:
🙈 Screenshots
👯♀️ Paired with