-
Notifications
You must be signed in to change notification settings - Fork 109
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: create a feature flag (disabled) #1716
Conversation
e0c3546
to
c52a50d
Compare
@@ -47,8 +52,15 @@ class LogoutPresenter @Inject constructor( | |||
mutableStateOf(Async.Uninitialized) | |||
} | |||
|
|||
val backupUploadState: BackupUploadState by remember { | |||
encryptionService.waitForBackupUploadSteadyState() | |||
val secureStorageFlag by featureFlagService.isFeatureEnabledFlow(FeatureFlags.SecureStorage) |
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.
Is setting to false for initial value not enough?
Otherwise we might want to use an Async
so we are sure we don't do anything while it's not Success
.
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.
If we set to false, it's false
then true
, which is not ideal, both for test (more intermediate states) and for prod.
I am looking how to improve this with Async
.
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.
Actually, I start with a null
value, and it seems to be OK (still testing it)
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
if (secureStorageFlag) { | ||
encryptionService.waitForBackupUploadSteadyState() | ||
} else { | ||
flowOf(BackupUploadState.Done) |
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.
Actually, I'd let the EncryptionService
handle this, so we don't have to check that in Presenters.
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 thought about doing like this, but I prefer to avoid this, since we had to give the FeatureFlagService
to the SDK which is a bit strange. We may iterate on this later.
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.
Our matrix
module is not really a sdk. I see what you mean, but it's not really the responsability of the Presenter
neither :/
import kotlinx.coroutines.launch | ||
import kotlinx.coroutines.runBlocking | ||
import javax.inject.Inject | ||
|
||
class LogoutPresenter @Inject constructor( | ||
private val matrixClient: MatrixClient, | ||
private val encryptionService: EncryptionService, |
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.
Not related to this PR, but could we change the EncryptionService
to something else? Maybe MatrixEncryptionService
?
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.
Some remarks, as I'd like to avoid runBlocking
...
If we are short on time, let's iterate later.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #1716 +/- ##
===========================================
- Coverage 63.43% 63.43% -0.01%
===========================================
Files 1282 1279 -3
Lines 33247 33184 -63
Branches 6883 6865 -18
===========================================
- Hits 21090 21050 -40
+ Misses 8975 8959 -16
+ Partials 3182 3175 -7
☔ View full report in Codecov by Sentry. |
c52a50d
to
d09d95b
Compare
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, since I think @ganfra isn't around at the moment and I think everything important is fixed. We can iterate later.
Kudos, SonarCloud Quality Gate passed! |
Type of change
Content
Add a feature flag for chat backup feature, disabled by default.
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist