Bug 464397 - Closing NeoChat when it doesn't have proper network connection will cause all account disappear
Summary: Closing NeoChat when it doesn't have proper network connection will cause all...
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources All
: NOR major
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-17 02:10 UTC by Gary Wang
Modified: 2024-07-28 12:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Wang 2023-01-17 02:10:03 UTC
SUMMARY

Closing NeoChat when it doesn't have proper network connection will cause all existing accounts disappear, thus when next time launching NeoChat, it will ask user to login in account as the account(s) never logged in.

This might happen when the end user have a bad network connection, and this might also happen when the user have a good network connection but the matrix homeserver is down.

STEPS TO REPRODUCE

1. When NeoChat complain about the network connection
2. Close NeoChat
3. (when the network or homeserver is back online) Launch NeoChat again

I'm not sure if it can be stable reproduced but I have already faced that issue 2 times and my workmate also got this issue as well. Since I don't know a proper way to "backup" existing account login token/information so prefer not to try to reproduce this bug intentionally, but these might be able to help developers to reproduce:

- Run a test matrix server locally and use NeoChat to connect to the server, stop the server to simulate homeserver downtime.
- Using a Wi-Fi connection, disconnect the Wi-Fi to simulate bad network.
- Setting up a local socks5 proxy via `ssh -D` and set this as proxy in NeoChat, then stop `ssh -D` to simulate bad network.
- Using a cable connection, unplug the cabel to simulate bad network.

OBSERVED RESULT

When re-launch NeoChat, all previous existing logined accounts disappeared, user will need to login them again.

EXPECTED RESULT

All accounts are still there when re-launch NeoChat. Additionally, if the network is still unreachable when user re-launch NeoChat, it should still keep all existing accounts.

SOFTWARE/OS VERSIONS
both master build and nightly version, not related to OS, but already got this issue on both Windows and Linux.

ADDITIONAL INFORMATION
Let me know if you need any additional information
Comment 1 Gary Wang 2023-01-17 02:32:06 UTC
Managed to reproduce this issue by losting all my login token again, some details:

When the network is down, we will need to wait for all "GetTokenOwnerJob" re-attempt failed, then it will attempt to do "LogoutJob" (but why?)

Log:

QML debugging is enabled. Only use this in a safe environment.
Reading access token from the keychain for "@blumia:kde.org"
Reading access token from the keychain for "@blumia:matrix.org"
Reading access token from the keychain for "@blumia:mozilla.org"
qrc:/main.qml:168: TypeError: Cannot read property 'contentItem' of null
quotient.jobs: No valid HTTP headers from GET https://kde.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #1 in 5 s
quotient.jobs: No valid HTTP headers from GET https://matrix-client.matrix.org/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #1 in 5 s
quotient.jobs: No valid HTTP headers from GET https://mozilla.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #1 in 5 s
quotient.jobs: No valid HTTP headers from GET https://kde.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #2 in 10 s
quotient.jobs: No valid HTTP headers from GET https://matrix-client.matrix.org/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #2 in 10 s
quotient.jobs: No valid HTTP headers from GET https://mozilla.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #2 in 10 s
quotient.jobs: No valid HTTP headers from GET https://matrix-client.matrix.org/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #3 in 30 s
quotient.jobs: No valid HTTP headers from GET https://kde.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #3 in 30 s
quotient.jobs: No valid HTTP headers from GET https://mozilla.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: "GetTokenOwnerJob": retry #3 in 30 s
quotient.jobs: No valid HTTP headers from GET https://matrix-client.matrix.org/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: No valid HTTP headers from GET https://mozilla.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: No valid HTTP headers from GET https://kde.modular.im/_matrix/client/v3/account/whoami
quotient.jobs: "GetTokenOwnerJob" status NetworkError: Connection closed
quotient.jobs: No valid HTTP headers from POST https://mozilla.modular.im/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #1 in 5 s
quotient.jobs: No valid HTTP headers from POST https://kde.modular.im/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #1 in 5 s
quotient.jobs: No valid HTTP headers from POST https://matrix-client.matrix.org/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #1 in 5 s
quotient.jobs: No valid HTTP headers from POST https://matrix-client.matrix.org/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #2 in 10 s
quotient.jobs: No valid HTTP headers from POST https://mozilla.modular.im/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #2 in 10 s
quotient.jobs: No valid HTTP headers from POST https://kde.modular.im/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #2 in 10 s
quotient.jobs: No valid HTTP headers from POST https://matrix-client.matrix.org/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #3 in 30 s
quotient.jobs: No valid HTTP headers from POST https://mozilla.modular.im/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #3 in 30 s
quotient.jobs: No valid HTTP headers from POST https://kde.modular.im/_matrix/client/v3/logout
quotient.jobs: "LogoutJob" status NetworkError: Connection closed
quotient.jobs: "LogoutJob": retry #3 in 30 s
Comment 2 Tobias Fella 2024-07-28 12:42:58 UTC
This is fixed; we're not removing connections automatically anymore.