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

Secure backup UI #1662

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Secure backup UI #1662

merged 2 commits into from
Oct 27, 2023

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 27, 2023

Remaining part of #1648 (see description there)

Screenshot are getting recorded.

@bmarty bmarty requested a review from a team as a code owner October 27, 2023 10:29
@bmarty bmarty requested review from ganfra and removed request for a team October 27, 2023 10:29
@ElementBot
Copy link
Collaborator

ElementBot commented Oct 27, 2023

Warnings
⚠️

libraries/designsystem/src/main/res/drawable/ic_key.xml#L7 - Very long vector path (1312 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

libraries/designsystem/src/main/res/drawable/ic_key_filled.xml#L23 - Very long vector path (1418 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

libraries/designsystem/src/main/res/drawable/ic_key_off.xml#L7 - Very long vector path (1446 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

libraries/ui-strings/src/main/res/values-cs/translations.xml#L187 - For locale "cs" (Czech) the following quantity should also be defined: many (e.g. "10.0 dne")

⚠️

libraries/ui-strings/src/main/res/values-cs/translations.xml#L192 - For locale "cs" (Czech) the following quantity should also be defined: many (e.g. "10.0 dne")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L199 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L204 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L209 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

Generated by 🚫 dangerJS against b418e5d

@sonarcloud
Copy link

sonarcloud bot commented Oct 27, 2023

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/6Wi6vf

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Attention: 300 lines in your changes are missing coverage. Please review.

Comparison is base (bf905dd) 63.04% compared to head (b418e5d) 63.50%.
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1662      +/-   ##
===========================================
+ Coverage    63.04%   63.50%   +0.46%     
===========================================
  Files         1223     1260      +37     
  Lines        31465    32508    +1043     
  Branches      6480     6738     +258     
===========================================
+ Hits         19837    20645     +808     
- Misses        8639     8744     +105     
- Partials      2989     3119     +130     
Files Coverage Δ
...ement/android/features/logout/impl/LogoutEvents.kt 100.00% <100.00%> (ø)
...lement/android/features/logout/impl/LogoutState.kt 100.00% <100.00%> (ø)
.../features/preferences/api/PreferencesEntryPoint.kt 0.00% <ø> (ø)
.../preferences/impl/root/PreferencesRootPresenter.kt 86.36% <100.00%> (+0.31%) ⬆️
...ures/preferences/impl/root/PreferencesRootState.kt 100.00% <100.00%> (ø)
...ferences/impl/root/PreferencesRootStateProvider.kt 100.00% <100.00%> (ø)
...t/android/features/roomlist/impl/RoomListEvents.kt 100.00% <100.00%> (ø)
...nt/android/features/roomlist/impl/RoomListState.kt 100.00% <100.00%> (ø)
...id/features/roomlist/impl/RoomListStateProvider.kt 97.91% <100.00%> (+0.18%) ⬆️
...nt/android/features/securebackup/impl/LoggerTag.kt 100.00% <100.00%> (ø)
... and 44 more

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmartinesp jmartinesp self-requested a review October 27, 2023 16:12
Copy link
Contributor

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM. I have a few comments, but they don't need to be done in this PR and some are more questions than issues found.

Also, it's super weird that when logging out, the backup upload state is always 'waiting' and displays the warning message.

var isLastSession by remember { mutableStateOf(false) }
LaunchedEffect(Unit) {
isLastSession = encryptionService.isLastDevice().getOrNull() ?: false
encryptionService.waitForBackupUploadSteadyState()
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not part of this PR, but the API is kind of weird, couldn't we just return the encryptionService.backupUploadStateStateFlow in a single call, instead of collecting the value somewhere and starting the subscription somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I can try to improve this.

@@ -195,6 +197,13 @@ private fun RoomListContent(
onDismissClicked = { state.eventSink(RoomListEvents.DismissRequestVerificationPrompt) }
)
}
} else if (state.displayRecoveryKeyPrompt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: use when? WDYT?

val recoveryKeyVisualTransformation = remember {
RecoveryKeyVisualTransformation()
}
OutlinedTextField(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: neither hardware nor software Enter key triggers the 'continue' action.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I can add this

onDone()
}
}
HeaderFooterPage(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since there is no content, I guess there are no designs? I didn't see any in Figma.

Copy link
Member Author

Choose a reason for hiding this comment

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

BottomMenu(
state = state,
onSaveClicked = { key ->
context.startSharePlainTextIntent(
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it a bit weird to use a share intent? Does it allow you to download it to a file or just copy the key? I couldn't test this myself.

Copy link
Member Author

Choose a reason for hiding this comment

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

It will propose to share the key as a String.

@bmarty bmarty merged commit b77089f into develop Oct 27, 2023
16 of 17 checks passed
@bmarty bmarty deleted the feature/bma/secureBackupUi branch October 27, 2023 16:36
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.

None yet

3 participants