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

Live Location Sharing - Update beacon info state event when sharing is ended #5758

Merged
merged 5 commits into from
Apr 14, 2022

Conversation

onurays
Copy link
Contributor

@onurays onurays commented Apr 13, 2022

No description provided.

@onurays onurays requested review from a team and mnaturel and removed request for a team April 13, 2022 17:13
@github-actions
Copy link

github-actions bot commented Apr 13, 2022

Unit Test Results

114 files  ±0  114 suites  ±0   1m 20s ⏱️ -10s
201 tests ±0  201 ✔️ ±0  0 💤 ±0  0 ±0 
674 runs  ±0  674 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit f49e7d9. ± Comparison against base commit 9b7e94e.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@mnaturel mnaturel left a comment

Choose a reason for hiding this comment

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

I have just added small comments to improve code.

@@ -140,6 +145,25 @@ class LocationSharingService : VectorService(), LocationTracker.Callback {
}
}

private fun updateStoppedBeaconInfo(roomId: String) {
Copy link
Contributor

Choose a reason for hiding this comment

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

To clarify namings what do you think about renaming this method to sendStoppedBeaconInfo() and the method sendBeaconInfo() to sendLivedBeaconInfo() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

override fun onServiceConnected(className: ComponentName, binder: IBinder) {
locationSharingService = (binder as LocationSharingService.LocalBinder).getService()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we reset locationSharingService to null in onServiceDisconnected for safety reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done.

?.let { session ->
session.coroutineScope.launch(session.coroutineDispatchers.io) {
val room = session.getRoom(roomId)
EventType
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we also need to add a filter to get all state events with lived=true. Normally there should be only a single live beacon per user per room. Maybe we need to extract it into a dedicated method to use it also in sendLiveLocation. I see in this last method 2 missing filters: the state_key=userId and lived=true which will be solved by this new method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to an helper function.

Copy link
Contributor

@mnaturel mnaturel left a comment

Choose a reason for hiding this comment

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

Okay for me.

@onurays onurays merged commit aa55b1f into develop Apr 14, 2022
@onurays onurays deleted the feature/ons/live_location_stop_sharing branch April 14, 2022 14:12
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