Skip to content

MS-1433 Persist data for MFID analytics events across activity recreation#1669

Merged
luhmirin-s merged 1 commit into
release/2026.2.0from
fixup/MS-1433-mfid-state-restortion
May 19, 2026
Merged

MS-1433 Persist data for MFID analytics events across activity recreation#1669
luhmirin-s merged 1 commit into
release/2026.2.0from
fixup/MS-1433-mfid-state-restortion

Conversation

@luhmirin-s
Copy link
Copy Markdown
Contributor

JIRA ticket
Will be released in: 2026.2.0

Root cause analysis (for bugfixes only)

First known affected version: 2026.1.0

  • Lateinit fields are not persisted if the "Don't keep activities" flag is enabled.
  • Fields in question are used for analytics and cannot be "recreated".

Notable changes

  • Add a basic persistence for the lateinit fields.

Testing guidance

  • Have “Don’t keep activities” enabled. Have MFID enabled in the project.
  • Start identification flow, capture face.
  • Press “Skip” on MFID selection screen
  • Press home/minimise the app
  • Reopen the app and press “Skip scanning”

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

@luhmirin-s luhmirin-s requested review from a team, BurningAXE, TristramN, alex-vt, alexandr-simprints, Copilot, meladRaouf and ybourgery and removed request for a team May 19, 2026 12:59
@cla-bot cla-bot Bot added the ... label May 19, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds SavedStateHandle-backed persistence for MFID external credential analytics timestamps/IDs so analytics events can survive ViewModel recreation.

Changes:

  • Injects SavedStateHandle into ExternalCredentialViewModel.
  • Restores and persists selection start time, selection event ID, and capture start time.
  • Adds unit tests covering persistence/restoration paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/controller/ExternalCredentialViewModel.kt Adds SavedStateHandle persistence for analytics-related fields.
feature/external-credential/src/test/java/com/simprints/feature/externalcredential/screens/controller/ExternalCredentialViewModelTest.kt Adds tests for saved/restored analytics state.

selectionEventId = eventsTracker.saveSelectionEvent(selectionStartTime, selectionEndTime, selectedType)
savedStateHandle[KEY_SELECTION_EVENT_ID] = selectionEventId
captureStartTime = timeHelper.now()
savedStateHandle[KEY_CAPTURE_START_TIME] = captureStartTime
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.

Should the savedStateHandle be updated in an onStop() callback instead of being scattered throughout the VM?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this is simpler and safer, since the onStop() could be called before "captureStartTime" is initialised and we would need to have extra error handling.

@luhmirin-s luhmirin-s force-pushed the fixup/MS-1433-mfid-state-restortion branch from 96f8680 to bb87640 Compare May 19, 2026 14:10
@sonarqubecloud
Copy link
Copy Markdown

@luhmirin-s luhmirin-s merged commit f09af30 into release/2026.2.0 May 19, 2026
14 checks passed
@luhmirin-s luhmirin-s deleted the fixup/MS-1433-mfid-state-restortion branch May 19, 2026 14:21
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