-
Notifications
You must be signed in to change notification settings - Fork 868
Fix unexpected live voice broadcast in the room list #7898
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
Conversation
c1f2573 to
fb7388d
Compare
1 similar comment
fb7388d to
21ca7c2
Compare
mnaturel
left a comment
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.
I have added comments about small improvements in code that could be done.
When testing with web, I achieved to reproduce the issue but I don't know if it is normal/expected. Here is how I reproduced:
- Go into the room list in Android.
- From web, start a live broadcast in a room.
- In Android, see the indicator for the room.
- In Web, pause and resume the live.
- In Web move the floating window of the live to be able to reach the option menu for the live broacast message in the timeline.
- From the context menu, remove the corresponding message.
- In Android, it says a broadcast is live even if it has been deleted.
| // Given | ||
| val aVoiceBroadcast = VoiceBroadcast(A_VOICE_BROADCAST_ID, A_ROOM_ID) | ||
| val aListOfTimelineEvents = listOf<TimelineEvent>( | ||
| mockk(relaxed = 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.
I think we could introduce a private method like givenAVoiceBroadcastEvent(eventId: String, isRedacted: Boolean, timestamp: Long) to be reused accross tests. It will make the tests faster to read.
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.
Done 493fa7a
| class FakeRoom( | ||
| private val fakeLocationSharingService: FakeLocationSharingService = FakeLocationSharingService(), | ||
| private val fakeSendService: FakeSendService = FakeSendService(), | ||
| private val fakeTimelineService: FakeTimelineService = FakeTimelineService(), |
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.
Normally there is no need to make the fakes public. You could mock the call in your tests without using the "fake" components like this:
fakeSession.roomService()
.getRoom(A_ROOM_ID)
.timelineService()
.getTimelineEventsRelatedTo(any(), any())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.
Fixed 2df9480
21ca7c2 to
6b60b0a
Compare
@mnaturel Thanks for your good test, I mainly fixed your issue but it will be totally fixed when implementing the MSC3912 because when you delete the started event, the related events are not redacted for the moment. In your test, the latest event in the room summary is the |
6b60b0a to
f62f661
Compare
|
SonarCloud Quality Gate failed. |
mnaturel
left a comment
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.
Thanks for the updates and the explanation. LGTM!








Type of change
Content
Sometimes, Voice Broadcasts were shown as live in the room list by error due to redaction on state events.
In this PR, the most recent state event is taken like in the room timeline to display the correct voice broadcast state. Event redactions are correctly handled.
Motivation and context
Fix #7832
Screenshots / GIFs
Tests
Tested devices
Checklist