[MS-1545] Increment attempt number on face recapture - #1791
Open
meladRaouf wants to merge 1 commit into
Open
Conversation
luhmirin-s
approved these changes
Aug 17, 2026
luhmirin-s
left a comment
Contributor
There was a problem hiding this comment.
Comments are a bit excessive, IMO.
meladRaouf
force-pushed
the
bugfix/record-face-capture-attempts
branch
from
August 17, 2026 13:22
1ba532d to
ca44ced
Compare
meladRaouf
requested review from
BurningAXE,
alex-vt,
alexandr-simprints and
luhmirin-s
and
a lite review from Copilot
August 17, 2026 13:22
meladRaouf
marked this pull request as ready for review
August 17, 2026 13:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MS-1545
Will be released in: version
Root cause analysis (for bugfixes only)
First known affected version: v2021.3.0
FaceCaptureEvent.attemptNbwas always0in analytics, regardless of how many times a user retook their face capture.FaceCaptureViewModel.attemptNumberused to be incremented as a side-effect of acanRetryproperty getter (get() = attemptNumber++ < maxRetries), used by a dedicated retry-limit screen. That screen (RetryFragment,canRetry,handleRetry()) was removed in commit8fd088e4e4("test removing retry flow", 2021-06-10), but theattemptNumberfield was kept (still read when buildingFaceCaptureEvents) without anything left to increment it. It has been stuck at its initial value since.Notable changes
FaceCaptureViewModel.recapture()now incrementsattemptNumberon every recapture (covers the confirmation screen's decline/back-press/retake actions and the "no face detected" auto-retry).LiveFeedbackViewModel.showValidationErrorAndReset()now also increments the attempt count on a failed spoof-check retry, so each retry gets a distinctattemptNbinstead of collapsing into one.attemptNumberis now backed bySavedStateHandleso it survives process death, and encapsulated with a private setter (only mutable viarecapture()/internal reset) instead of a public mutable field.initFaceBioSdkresets the per-step state (attemptNumber,initialised) when a new capture step starts for a different face SDK, sinceFaceCaptureViewModelis Activity-scoped and can be reused across multiple face-capture steps (e.g. a project configured with more than one face SDK).LiveFeedbackViewModel.attemptNumber = 1) that was always overwritten before use.Testing guidance
FaceCaptureViewModelTest: verifiesattemptNumberincrements onrecapture(), survives being restored from aSavedStateHandle, and resets when a capture step starts for a different SDK.LiveFeedbackViewModelTest: verifies a failed spoof-check retry reports an incrementing attempt number viaSimpleCaptureEventReporter.addCaptureEvents.FaceCaptureEvent.attemptNbincrements per retry instead of staying at0.Additional work checklist