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

RPC downtime needs helpful message #108

Open
elliotBraem opened this issue Jun 6, 2024 · 0 comments
Open

RPC downtime needs helpful message #108

elliotBraem opened this issue Jun 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@elliotBraem
Copy link
Contributor

During RPC downtime, bos-workspace may give an error like:

✓ bos-workspace running on port 8080!
⋅ [widget/page/projects/Editor.jsx] changed: rebuilding app...
/home/zeeshan/gateway/node_modules/bos-workspace/dist/lib/server.js:168
                    json.result.result = Array.from(new TextEncoder().encode(JSON.stringify(devWidget)));
                                       ^

TypeError: Cannot set properties of undefined (setting 'result')
    at /home/zeeshan/gateway/node_modules/bos-workspace/dist/lib/server.js:168:40
    at Generator.next (<anonymous>)
    at fulfilled (/home/zeeshan/gateway/node_modules/bos-workspace/dist/lib/server.js:5:58)

Node.js v22.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This is because we proxy rpc requests and if the original rpc is down, then result will not be set.

TypeError: Cannot set properties of undefined (setting 'result')

We should catch this error and provide a helpful message, like:

log.warn(`Request to default rpc (${default_rpc}) failed and may be facing outages. Try again shortly or configure a different rpc`)

The above implies being able to customize rpc in bos.config.json too, this feature would need to be added.

This also should not impact locally developed widgets

@elliotBraem elliotBraem added the bug Something isn't working label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant