-
Notifications
You must be signed in to change notification settings - Fork 754
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
[Device management] Add lab flag for matrix client info account data event (PSG-800) #7352
[Device management] Add lab flag for matrix client info account data event (PSG-800) #7352
Conversation
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, just some minor remarks.
@@ -42,6 +42,7 @@ | |||
<bool name="settings_labs_thread_messages_default">false</bool> | |||
<bool name="settings_labs_new_app_layout_default">true</bool> | |||
<bool name="settings_labs_new_session_manager_default">false</bool> | |||
<bool name="settings_labs_client_info_recording_default">false</bool> |
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.
You could also create a settings_labs_client_info_recording_visible
to toggle the visibility of this lab flag. Can be useful for other forks. See the doc at the top of the file.
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.
Okay, I see. I will update. I will add one also for the lab flag of new session manager as well.
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 in 8613221
private fun configureEnableClientInfoRecordingPreference() { | ||
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_LABS_CLIENT_INFO_RECORDING_KEY)?.onPreferenceChangeListener = | ||
OnPreferenceChangeListener { _, newValue -> | ||
when { |
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.
Maybe change to when (newValue as? Boolean)
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.
Updated in 189e772
import im.vector.app.core.session.clientinfo.UpdateMatrixClientInfoUseCase | ||
import kotlinx.coroutines.launch | ||
|
||
class VectorSettingsLabsViewModel @AssistedInject constructor( |
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 introducing a ViewModel here!
|
||
private fun handleDeleteRecordedClientInfo() { | ||
viewModelScope.launch { | ||
deleteMatrixClientInfoUseCase.execute() |
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.
For parity it's strange that updateMatrixClientInfoUseCase
takes a session as param and deleteMatrixClientInfoUseCase
doesn't.
Maybe change the Former (updateMatrixClientInfoUseCase
)?
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.
In fact, for that I was constrained by the fact updateMatrixClientInfoUseCase
is indirectly injected in ActiveSessionHolder
. To avoid cyclic dependency, I had to make the session as a parameter. I would like to avoid adding the session as parameter to deleteMatrixClientInfoUseCase
unless you really think we should align the parameters.
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, no this is fine, thanks for explaining.
SonarCloud Quality Gate failed. |
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 update!
Type of change
Content
Adding a lab flag to toggle the client info recording used to provide Application info in the session details screen.
Motivation and context
Closes #7344
Screenshots / GIFs
Tests
Tested devices
Checklist