feat: add e2ei expiration control in debug tools and shake routing by flavor [WPB-24275]#4773
feat: add e2ei expiration control in debug tools and shake routing by flavor [WPB-24275]#4773
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4773 +/- ##
===========================================
+ Coverage 50.80% 50.83% +0.02%
===========================================
Files 605 605
Lines 20887 20900 +13
Branches 3370 3370
===========================================
+ Hits 10612 10624 +12
- Misses 9276 9277 +1
Partials 999 999
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
| ) | ||
| } | ||
| ) | ||
| HorizontalDivider(modifier = Modifier.height(1.dp)) |
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| OutlinedTextField( | ||
| modifier = Modifier.width(128.dp), |
| value = expirationInput, | ||
| onValueChange = { input -> |
There was a problem hiding this comment.
You could also use TextFieldState instead, so that we use more recent textfields v2 if possible
| val minExpirationMinutes = MIN_DEBUG_E2EI_CERTIFICATE_EXPIRATION_SECONDS / 60 | ||
| val expirationMinutes = expirationSeconds / 60 | ||
| var expirationInput by remember { mutableStateOf(expirationMinutes.toString()) } | ||
| val isInputBelowMinimum = expirationInput.toLongOrNull()?.let { it < minExpirationMinutes } == true | ||
|
|
||
| LaunchedEffect(expirationSeconds) { | ||
| val minutesFromState = (expirationSeconds / 60).toString() | ||
| if (expirationInput != minutesFromState) { | ||
| expirationInput = minutesFromState | ||
| } | ||
| } |
There was a problem hiding this comment.
This feels a little bit too complex, it could definitely be simpler 😄
If you pass expirationSeconds state already then why do we need another expirationInput state here instead of just using the one that's passed?
Also, it's being reduced so that the input shows only full minutes, so when expirationSeconds is 90 seconds, then input will show 1 minute, which is not correct, right?
| modifier = Modifier.width(128.dp), | ||
| value = expirationInput, | ||
| onValueChange = { input -> | ||
| val digitsOnly = input.filter { it.isDigit() } |
There was a problem hiding this comment.
Instead of that, pass inputTransformation so that it won't accept anything other than digits, so no need to worry about that and we can assume that entered value always contains only digits, we already have a InputTransformation.maxLengthDigits(maxLength: Int) specifically for that
| start = dimensions().spacing8x, | ||
| end = dimensions().spacing8x, | ||
| top = dimensions().spacing8x, | ||
| bottom = dimensions().spacing8x |
There was a problem hiding this comment.
All the same values, can be reduced to a single dimension().spacing8x



https://wearezeta.atlassian.net/browse/WPB-24275
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764The PR Description
What's new in this PR?
Issues
Solutions
6 min(360s).