-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[MM-62925] introduce websocket client-side ping #8633
base: main
Are you sure you want to change the base?
Conversation
@yasserfaraazkhan and @larkox - the E2E android tests had failures on the last run here, and the check reported an overall failure. The E2E iOS tests also had failures on the last run, but the check reported an overall success. Is that expected? Additionally, I looked back at the last few merged PRs to see if the E2E android test failures were expected, and it appears that we did not run them. Should I be running them for my PR? And if so, are the results currently stable and expected to succeed on the master branch? Trying to figure out if there are legitimate issues with my changes that need to be addressed 🙂 |
@davidkrauser I see the android build step failed with error For now, we can use iOS e2e tests on PR. There are few flaky failing tests. Usually, if the overall % is around 90. That should be good. We will get to fixing or disabling the flaky tests in future. |
@yasserfaraazkhan I see you've already been taking a look at this one, but I was added as a reviewer. Should I remove myself and add you instead? |
@lindalumitchell I've only reviewed the e2e tests. You can try some more scenarios. |
This PR is a continuation of #8619. The PR was migrated to a branch on the upstream repository because E2E tests can't execute on branches from forked repositories.
Summary
This PR introduces new functionality on the client side to send PING messages over the websocket. If the server doesn't respond within
PING_INTERVAL
(currently 30 seconds), the connection is closed and re-created. This will allow us to find broken connections more quickly.Ticket Link
https://mattermost.atlassian.net/browse/MM-62925
This is related to a similar change in the webapp client: mattermost/mattermost#30293
Testing at the Application Layer
This change can be manually verified using a
mitmproxy
that intermittently drops websocket messages. This script will drop every otherPONG
message from the server, starting with the first:This proxy can be run with:
That will start delivering requests on
localhost:8080
to a local mattermost instance on the default port.Additionally to get around some CORS checks, the local instance needs to have its base URL set to
http://LOCAL_HOST_IP:8080
in the system console. The mobile app should connect tohttp://LOCAL_HOST_IP:8080
.With everything up and running, you'll see:
PING
, but the serverPONG
message is droppedPONG
was never received).PING
/PONG
interaction with the serverTesting at the Network Layer
We can also verify that the connection is re-established quickly after a failed attempt to send a PING message. This can happen if the packets are being rejected.
To test on a Mac:
localhost
at port8065
localhost:8065
)http://LOCAL_HOST_IP:8065
in the system console.http://LOCAL_HOST_IP:8065
.sudo pfctl -e && echo "block return proto tcp to port 8065" | sudo pfctl -f -
. This will block all tcp traffic to port 8065.sudo pfctl -d
. This will start allowing tcp traffic againChecklist
E2E iOS tests for PR
.Release Note