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

[VoiceBroadcast] Add the last sequence number in the paused/stopped state event #7136

Merged
merged 4 commits into from
Dec 5, 2022

Conversation

phloux
Copy link
Contributor

@phloux phloux commented Dec 2, 2022

Add the last sequence number in the paused/stopped state event for Voice Broadcast

@phloux phloux force-pushed the phlpro/voicebroadcast_last_sequence_number branch from 68dc34b to d41d03c Compare December 2, 2022 15:27
@phloux phloux requested review from yostyle and giomfo December 2, 2022 15:27
@phloux phloux marked this pull request as ready for review December 2, 2022 15:47
@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Base: 11.76% // Head: 11.75% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (ca8e98f) compared to base (f2ab29b).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7136      +/-   ##
===========================================
- Coverage    11.76%   11.75%   -0.02%     
===========================================
  Files         1620     1620              
  Lines       159388   159369      -19     
  Branches     64884    64878       -6     
===========================================
- Hits         18759    18738      -21     
- Misses      139978   139993      +15     
+ Partials       651      638      -13     
Flag Coverage Δ
uitests 54.68% <ø> (-0.16%) ⬇️
unittests 5.98% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ceBroadcast/VoiceBroadcastSDK/VoiceBroadcastInfo.m 0.00% <0.00%> (ø)
...cast/VoiceBroadcastSDK/VoiceBroadcastService.swift 0.00% <0.00%> (ø)
...vice/MatrixSDK/VoiceBroadcastRecorderService.swift 0.00% <0.00%> (ø)
...eateActionList/View/ComposerCreateActionList.swift 75.34% <0.00%> (-5.85%) ⬇️
...castPlayback/View/VoiceBroadcastPlaybackView.swift 0.00% <0.00%> (ø)
...castRecorder/View/VoiceBroadcastRecorderView.swift 0.00% <0.00%> (ø)
...ojiPicker/Data/EmojiMart/EmojiItem+EmojiMart.swift 95.65% <0.00%> (+0.30%) ⬆️
RiotSwiftUI/Modules/Common/Mock/ScreenList.swift 90.19% <0.00%> (+5.88%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.


NSInteger lastChunkSequence = -1;
if (JSONDictionary[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkLastSequence]) {
MXJSONModelSetInteger(chunkLength, JSONDictionary[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkLastSequence]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
MXJSONModelSetInteger(chunkLength, JSONDictionary[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkLastSequence]);
MXJSONModelSetInteger(lastChunkSequence, JSONDictionary[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkLastSequence]);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in last commit.

@@ -66,8 +68,13 @@ + (id)modelFromJSON:(NSDictionary *)JSONDictionary
voiceBroadcastId = relatesTo.eventId;
}
}

NSInteger lastChunkSequence = -1;
Copy link
Member

Choose a reason for hiding this comment

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

I think you can use 0 as default value, because the actual first chunk sequence is 1
@yostyle can you confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in last commit. The first chunk sequence is 1 by default.

@@ -86,6 +93,10 @@ - (NSDictionary *)JSONDictionary
JSONDictionary[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkLength] = @(self.chunkLength);
}

if (self.lastChunkSequence > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (self.lastChunkSequence > 0) {
if (self.lastChunkSequence != 0) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in last commit.

@@ -241,10 +252,13 @@ extension VoiceBroadcastService {

/// Stop a voice broadcast.
/// - Parameters:
/// - lastChunkSequence: The last chunk number.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// - lastChunkSequence: The last chunk number.
/// - lastChunkSequence: The last sent chunk number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in last commit.

@@ -211,10 +219,13 @@ extension VoiceBroadcastService {

/// Pause a voice broadcast.
/// - Parameters:
/// - lastChunkSequence: The last chunk number.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// - lastChunkSequence: The last chunk number.
/// - lastChunkSequence: The last sent chunk number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in last commit.

if let lastChunkSequence = lastChunkSequence {
voiceBroadcastInfo.lastChunkSequence = lastChunkSequence
}

Copy link
Member

Choose a reason for hiding this comment

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

lastChunkSequence is not initialized correctly here, we should add :
else voiceBroadcastInfo.lastChunkSequence = 0

Why don't we use the (initWithDeviceId...)[https://github.com//pull/7136/files#diff-3984ce62497db3e36cab4bcb87c1bb1d97d140510c5acba01b76c0b907d189caR22] method to init voiceBroadcastInfo instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in last commit.

@sonarcloud
Copy link

sonarcloud bot commented Dec 2, 2022

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

@phloux phloux merged commit b5c4ef3 into develop Dec 5, 2022
@phloux phloux deleted the phlpro/voicebroadcast_last_sequence_number branch December 5, 2022 07:19
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.

3 participants