-
Notifications
You must be signed in to change notification settings - Fork 187
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
Restore manual Client
cleanup on session logout
#4333
Restore manual Client
cleanup on session logout
#4333
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4333 +/- ##
===========================================
- Coverage 80.17% 80.17% -0.01%
===========================================
Files 2058 2058
Lines 54792 54805 +13
Branches 6707 6708 +1
===========================================
+ Hits 43928 43938 +10
- Misses 8565 8568 +3
Partials 2299 2299 ☔ View full report in Codecov by Sentry. |
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.
LGTM, thanks!
@@ -101,7 +109,7 @@ class RustClientSessionDelegate( | |||
} else { | |||
clientLog.d("No session data found.") | |||
} | |||
client?.logout(userInitiated = false, ignoreSdkError = true) | |||
client.get()?.logout(userInitiated = false, ignoreSdkError = true) |
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.
This is not new, but I am wondering why we are not using currentClient
here (instead of client.get()?
).
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.
No reason, it's better to use currentClient
indeed!
This is done to fix an issue where the Nodes that contain these dependencies are leaked and the `Client` and other SDK-related components can keep working in background for a while, until the caches holding the Nodes are flushed or the app is restarted.
280ba98
to
91da7fe
Compare
|
Content
Client
instances and related dependencies cleanup when the user logs out.Client
/MatrixClient
.runCatching
to prevent issues if some component is called when its Rust reference has been destroyed.Motivation and context
This is done as a workaround for #4326.
Tests
Log out, check the
Client
is not running in the background anymore.Tested devices
Checklist