[PM-27135] feat: Add Use Passkey screen - #2947
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Re-reviewed the third PR in the TestHarness passkey stack after the Code Review Details
PR Metadata Assessment
|
| if store.state.registeredCredentials.isEmpty { | ||
| Text(Localizations.sdkNoRegisteredCredentials) | ||
| .foregroundStyle(.secondary) |
There was a problem hiding this comment.
Details and fix
registeredCredentials starts [] and status starts .idle, so SwiftUI evaluates body and shows the empty-state message before .task { await store.perform(.loadRegisteredCredentials) } completes. That load is not cheap on the first call — DefaultSDKPasskeyService.session() hits the keychain and then runs initializeUserCrypto with 600,000 PBKDF2 iterations — so the misleading "Use Register Passkey (SDK) to create one" message is visible for a noticeable moment even when credentials do exist. For a harness screen whose whole job is to list registered credentials, that can read as a registration failure.
Distinguishing "not loaded yet" from "loaded and empty" fixes it, e.g. add a loading flag to the state:
// SDKUsePasskeyState
var isLoadingCredentials = true// SDKUsePasskeyProcessor.loadRegisteredCredentials()
defer { state.isLoadingCredentials = false }// SDKUsePasskeyView.registeredCredentialsSection
if store.state.isLoadingCredentials {
ProgressView()
} else if store.state.registeredCredentials.isEmpty {
Text(Localizations.sdkNoRegisteredCredentials)
.foregroundStyle(.secondary)
} else {
// ...
}This also covers the tap path: .disabled(store.state.status == .inProgress) silently disables the rows during an assertion with no visible indicator, unlike SDKRegisterPasskeyView, which shows a ProgressView next to its button.
544b847 to
5065ad1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pm-27134-testharness-register-passkeys-ui #2947 +/- ##
=============================================================================
- Coverage 79.48% 79.47% -0.01%
=============================================================================
Files 1172 1172
Lines 75144 75144
=============================================================================
- Hits 59726 59724 -2
- Misses 15418 15420 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5065ad1 to
ad91844
Compare
ad91844 to
2daf425
Compare
2daf425 to
5669016
Compare
5669016 to
c2a8b7a
Compare
c2a8b7a to
9d219bb
Compare
9d219bb to
eedacf1
Compare
Adds the "Use Passkey" scenario: lists credentials registered via PasskeyService.registeredCredentials, and asserts against the tapped credential's specific credential ID and relying party ID via PasskeyService.assertPasskey, showing the resulting relying party ID and username. Wires it into the scenario picker and root navigation.
eedacf1 to
9f46c09
Compare
🎟️ Tracking
PM-27135
📔 Objective
Third PR in a 4-PR stack adding SDK-backed passkey test scenarios to TestHarness. Stacked on #2946.
SDKPasskeyService.registeredCredentials, and asserts against the tapped credential's specific credential ID and relying party ID viaSDKPasskeyService.assertPasskey, showing the resulting relying party ID and username.📸 Screenshots
Stack: #2945 → #2946 → #2947 → #2948