Skip to content

Conversation

@mnaturel
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Handling click on the "Verify" button in the session overview screen for other session than the current one.

Motivation and context

Closes #7143

Screenshots / GIFs

No UI changed.

Tests

  • Enable the new device management feature flag
  • Go to Settings -> Security & Privacy -> Show All Sessions (V2, WIP)
  • Find another session which is not verified
  • Go to the session overview screen
  • Check the "Verify" button is only visible when the current signed in session is verified
  • Press the "Verify" button
  • Check the verification request is received in the other session

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 11

Checklist

@mnaturel mnaturel changed the title [Device management] Verify another session [Device management] Verify another session (PSG-722) Sep 16, 2022
@mnaturel mnaturel marked this pull request as ready for review September 16, 2022 13:28
@mnaturel mnaturel requested review from a team and fedrunov and removed request for a team September 16, 2022 13:29

sealed class SessionOverviewViewEvent : VectorViewEvents {
data class SelfVerification(val session: Session) : SessionOverviewViewEvent()
data class ShowVerifyCurrentSession(val session: Session) : SessionOverviewViewEvent()
Copy link
Member

@bmarty bmarty Sep 16, 2022

Choose a reason for hiding this comment

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

Just a small remark: please remove the session class member.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes thanks, I removed the argument.

@mnaturel mnaturel force-pushed the feature/mna/device-manager-verify-current-session branch from d578dbe to 4f3df2c Compare September 19, 2022 08:05
@mnaturel mnaturel force-pushed the feature/mna/device-manager-verify-other-session branch from 6c8cd04 to ef34f69 Compare September 19, 2022 08:16
@mnaturel mnaturel requested a review from bmarty September 19, 2022 08:17
Copy link
Contributor

@fedrunov fedrunov left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

updateEntryDetails(state.deviceId)
if (state.deviceInfo is Success) {
renderSessionInfo(state.isCurrentSession, state.deviceInfo.invoke())
renderSessionInfo(state.isCurrentSession, state.deviceInfo.invoke(), state.isCurrentSessionTrusted)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Maybe passing the state as a single argument could be simpler, but maybe not, because of the type check of state.deviceInfo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved all the logic into a updateSessionInfo() method. See f54955d

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

One tiny last remark that you could simply ignore, else LGTM!

)
views.sessionOverviewInfo.render(infoViewState, dateFormatter, drawableProvider, colorProvider)
} else {
hideSessionInfo()
Copy link
Member

Choose a reason for hiding this comment

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

For clarity/parity, I would then remove fun hideSessionInfo() and just write:

Suggested change
hideSessionInfo()
views.sessionOverviewInfo.isVisible = false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will make this change in a following PR.

@mnaturel mnaturel force-pushed the feature/mna/device-manager-verify-current-session branch from 4f3df2c to 963c5f8 Compare September 19, 2022 12:47
@mnaturel mnaturel force-pushed the feature/mna/device-manager-verify-other-session branch from f54955d to 2eb0391 Compare September 19, 2022 12:56
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@mnaturel mnaturel force-pushed the feature/mna/device-manager-verify-other-session branch from 2eb0391 to 943ec7e Compare September 20, 2022 08:46
@mnaturel mnaturel force-pushed the feature/mna/device-manager-verify-current-session branch from 963c5f8 to 54a4dc7 Compare September 20, 2022 08:47
Base automatically changed from feature/mna/device-manager-verify-current-session to develop September 22, 2022 09:46
@bmarty bmarty merged commit e98bfe5 into develop Sep 22, 2022
@bmarty bmarty deleted the feature/mna/device-manager-verify-other-session branch September 22, 2022 09:46
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.

[Device management] Verify another session

4 participants