-
Notifications
You must be signed in to change notification settings - Fork 706
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
tracking number of spaces user joined #5300
Conversation
Unit Test Results110 files +12 110 suites +12 1m 18s ⏱️ +13s Results for commit 87df7a9. ± Comparison against base commit 5de7873. This pull request removes 12 and adds 29 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Matrix SDKIntegration Tests Results:
|
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.
Some thoughts about the implementation
...dk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncResponseHandler.kt
Outdated
Show resolved
Hide resolved
matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt
Outdated
Show resolved
Hide resolved
private fun observeSyncStatus(session: Session) { | ||
session.getSyncStatusLive() | ||
.asFlow() | ||
.filterIsInstance<SyncStatusService.Status.IncrementalSyncDone>() |
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.
we can use Flow.distinct
to avoid keeping track of the previous state https://github.com/vector-im/element-android/pull/5300/files#diff-d5584663de96dcd881e4441839a2a6e44b50a58268b0b9af4d17be21fba9897fR152
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.
👍 added one line below
.filterIsInstance<SyncStatusService.Status.IncrementalSyncDone>() | ||
.onEach { | ||
handleJoinedSpaceStatistics(session.spaceService().getRootSpaceSummaries().size) | ||
}.launchIn(session.coroutineScope) |
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 going to subscribe each time you switch space, no?
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.
Why do you think so? observeSyncStatus
called when session is changed and it subscribes to a sync status.
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.
check the latest changes, it's now a little bit different
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! will leave to @ganfra (and confirming the space switching behaviour)
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.
Ok, LGTM now, thanks
closes #5299