-
Notifications
You must be signed in to change notification settings - Fork 501
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
Background audio messages info (PSB-180) #6870
Conversation
Kudos, SonarCloud Quality Gate passed! |
📱 Scan the QR code below to install the build for this PR. If you can't scan the QR code you can install the build via this link: https://i.diawi.com/miQ3Ad |
Codecov ReportBase: 11.63% // Head: 11.63% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #6870 +/- ##
===========================================
- Coverage 11.63% 11.63% -0.01%
===========================================
Files 1559 1559
Lines 155250 155255 +5
Branches 62667 62668 +1
===========================================
- Hits 18060 18057 -3
- Misses 136578 136586 +8
Partials 612 612
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. |
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.
The code looks fine to me but I'm going to question the decision to remove useful info from the now playing screen on Element. We may have users that are used to having this and I can't really see any justification for removing it for regular users.
Could that change perhaps also be behind a build flag?
@@ -198,13 +199,23 @@ class VoiceMessageAudioPlayer: NSObject { | |||
(delegate as? VoiceMessageAudioPlayerDelegate)?.audioPlayerDidFinishPlaying(self) | |||
} | |||
} | |||
|
|||
appBackgroundObserver = NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: nil) { [weak self] _ in | |||
guard let self = self, !BuildSettings.allowBackgroundAudioMessagePlayback else { return } |
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.
Would it be worth adding a check for isPlaying
in here too?
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 don't think so. Pausing a paused stream looks like a nop.
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.
Even for any of the delegates that get called?
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.
Tried it, I'm not seeing anything bad in the app.
That sounds reasonable to me.
What do you think @Johennes? |
We had discussed removing the possibly sensitive info on the lock screen with product before and reached this decision due to privacy concerns. This does seem like a relatively granular setting so my personal tendency is to pick a sensible default rather than adding another configuration option. @jakewb-b maybe you could expand on this? |
Another option I was thinking is to have 3-states build setting like this: extension BuildSetting {
enum BackgroundAudioPlayerBehaviour {
case off
case `default`
case anonymous
}
static let backgroundAudioPlayerBehaviour: BackgroundAudioPlayerBehaviour = .default
} But probably it's better to understand with @jakewb-b if this should be or not a runtime setting. |
As a rule I’d much prefer to avoid additional settings and choose a sensible default, as Johannes suggests. In this case, if we’re going with a default we should bias for privacy and I’m content to remove the information from the lock screen as I think it’s of relatively low utility and, while any change may be a surprise to users, it’s not something that seems likely to cause huge issues in using the feature. I think there could be a case in the future for a runtime setting that bundles a few other items into one privacy choice to, for example, ‘minimise display of room and user information on lock screen’ but we’d need to work out if there are, in practice, any other items that could usefully be bundled with this. In the short term, this mustn’t block us progressing so let’s go with hiding the information for now and then review. |
Thanks Jake, |
Ticket -> https://element-io.atlassian.net/browse/PSB-180?atlOrigin=eyJpIjoiM2QxY2RmZWM1MDcxNDAwN2E1YWJiYjU3OWM2MmZkMzUiLCJwIjoiaiJ9
This PR
BuildSetting.allowBackgroundAudioMessagePlayback
to disable the background audio feature completely