-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
Feat/websocket-client package #15797
base: develop
Are you sure you want to change the base?
Conversation
🚀 Expo preview is ready!
|
a0fc770
to
221cfac
Compare
15ffec4
to
42604de
Compare
last minute changes. new package renamed to |
42604de
to
6412ddb
Compare
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/12297127542 |
d56c090
to
1824969
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
if (url.startsWith('https')) { | ||
url = url.replace('https', 'wss'); | ||
} | ||
if (url.startsWith('http')) { | ||
url = url.replace('http', 'ws'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total nitpick: the second one covers the first one as well
} | ||
|
||
protected onMessage(message: string) { | ||
protected onMessage(message: WebsocketResponse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not very important, but these overriden onMessage
don't call setPingTimeout
as the base one does, so the pings will be timed differently.
im not sure if failing android e2e are somehow related to this change or not? |
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/12368290749 |
1824969
to
1d3f760
Compare
android tests look like they have hanged for 40 minutes albeit finishing correctly and it is probably somehow related. nightly scheduled test finished successfully just 8 hours ago. Here is the list of recently finished android tests - https://github.com/trezor/trezor-suite/actions/workflows/test-suite-native-e2e-android.yml |
lets try rebasing it and see whether android tests pass or not |
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/12862656946 |
1d3f760
to
f693b8c
Compare
android tests still timing out - https://github.com/trezor/trezor-suite/actions/runs/12862670578/job/35858213762?pr=15797#step:11:403 something has changed in the unified websocket implementation for suite-native apparently |
@mroz22, there is probably hanging synchronization with the new WebSocket implementation. Detox E2E tests synchronize with the network events and pause the test until the communication is closed (if you do not set it differently on purpose). More here. All the tests pass, but the connection stays open so the test never ends and it times out. I can look at the tests tomorrow if you need help. We have encountered this issue multiple times on mobile. |
69c5d49
to
fbd5a15
Compare
Description
Side quest from bluetooth
Create and use shared websocket package.
This is basically code moved from
blockchain-link/baseWebsocket
file to standalone package, so the logic behind connection/ping/timeouts and sending/receiving messages can be used elsewhereThis should be used in:
blockchain-link
(in this PR)trezor-user-env-link
(in this PR)transport-bluetooth
(in bluetooth branch )Additional benefit:
webpack configs doesnt need to use
webpack.NormalModuleReplacementPlugin
onws
moduleAdditional fixes:
.cache
directory (if you run playwright locally there are some .js builds in there)CustomError
in blockchain-link, there are few places where the error message is passed as code param like: