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

Room : makes subscribeToSync/unsubscribeFromSync suspendable #1457

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Sep 28, 2023

Rework how we use subscribe/unsubscribe on sync.
Previously the calls were synced and on the main thread, which could lead to break the navigation animation or even causes some ANR.
This is now handled properly with suspendable, and we keep a subscription count to avoid messing with the asynchronous nature of node lifecycle and coroutines.

@ganfra ganfra marked this pull request as ready for review September 28, 2023 18:18
@ganfra ganfra requested a review from a team as a code owner September 28, 2023 18:18
@ganfra ganfra requested review from bmarty and removed request for a team September 28, 2023 18:18
@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/9XhWtN

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: 45 lines in your changes are missing coverage. Please review.

Comparison is base (ce96c73) 57.92% compared to head (a84e823) 57.85%.
Report is 14 commits behind head on develop.

❗ Current head a84e823 differs from pull request most recent head d837b33. Consider uploading reports for the commit d837b33 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1457      +/-   ##
===========================================
- Coverage    57.92%   57.85%   -0.07%     
===========================================
  Files         1129     1130       +1     
  Lines        30046    30080      +34     
  Branches      6144     6148       +4     
===========================================
  Hits         17404    17404              
- Misses       10031    10065      +34     
  Partials      2611     2611              
Files Coverage Δ
...nt/android/libraries/matrix/api/room/MatrixRoom.kt 28.57% <ø> (ø)
.../android/libraries/matrix/impl/RustMatrixClient.kt 0.00% <0.00%> (ø)
...droid/libraries/matrix/test/room/FakeMatrixRoom.kt 90.77% <0.00%> (ø)
...droid/libraries/matrix/impl/room/RustMatrixRoom.kt 0.00% <0.00%> (ø)
...d/libraries/matrix/impl/room/RoomSyncSubscriber.kt 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. Maybe add an entry for the changelog? Not sure since it does not change anything for the user, but it may help to investigate regression (if any!)

@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ganfra ganfra merged commit fa82639 into develop Sep 29, 2023
12 checks passed
@ganfra ganfra deleted the feature/fga/suspend_subscribe_unsubscribe_sync branch September 29, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants