Skip to content

feat: add e2ei expiration control in debug tools and shake routing by flavor [WPB-24275]#4773

Open
Garzas wants to merge 5 commits intodevelopfrom
feat/e2ei-debug-expiration-tools
Open

feat: add e2ei expiration control in debug tools and shake routing by flavor [WPB-24275]#4773
Garzas wants to merge 5 commits intodevelopfrom
feat/e2ei-debug-expiration-tools

Conversation

@Garzas
Copy link
Copy Markdown
Contributor

@Garzas Garzas commented Apr 29, 2026

https://wearezeta.atlassian.net/browse/WPB-24275


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • No usable debug UI for short E2EI certificate TTL testing.
  • Shake shortcut behavior was not flavor-aware.

Solutions

  • Added E2EI TTL controls in Developer Tools (minutes + enroll), wired to debug API.
  • Enforced UI minimum of 6 min (360s).
  • Improved section UI consistency and added TTL scope hint for enroll/update.
  • Updated shake routing:
    • private + debug-screen-enabled builds -> Debug Settings,
    • other builds -> Log Management.

@Garzas Garzas self-assigned this Apr 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 50.83%. Comparing base (02b5760) to head (62615d0).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...wire/android/ui/debug/DebugDataOptionsViewModel.kt 91.66% 1 Missing ⚠️
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              
Files with missing lines Coverage Δ
...rc/main/kotlin/com/wire/android/ui/WireActivity.kt 0.00% <ø> (ø)
...com/wire/android/ui/debug/DebugDataOptionsState.kt 100.00% <100.00%> (ø)
...wire/android/ui/debug/DebugDataOptionsViewModel.kt 52.56% <91.66%> (+3.25%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02b5760...62615d0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt Outdated
Comment thread app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt
Comment thread app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt Outdated
Comment thread app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt Outdated
@sonarqubecloud
Copy link
Copy Markdown

@Garzas Garzas requested a review from saleniuk April 30, 2026 10:24
)
}
)
HorizontalDivider(modifier = Modifier.height(1.dp))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use dimensions()

verticalAlignment = Alignment.CenterVertically
) {
OutlinedTextField(
modifier = Modifier.width(128.dp),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use dimensions()

Comment on lines +298 to +299
value = expirationInput,
onValueChange = { input ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could also use TextFieldState instead, so that we use more recent textfields v2 if possible

Comment on lines +266 to +276
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
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment on lines +289 to +292
start = dimensions().spacing8x,
end = dimensions().spacing8x,
top = dimensions().spacing8x,
bottom = dimensions().spacing8x
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All the same values, can be reduced to a single dimension().spacing8x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants