Skip to content

Conversation

@alex-vt
Copy link
Contributor

@alex-vt alex-vt commented Feb 9, 2026

JIRA ticket
Will be released in: 2026.2.0

Notable changes

  • Housekeeping / codebase cleanup task: suspending removed from functions that return flows
  • Scanner code left untouched: difficult to verify, and to be deprecated anyway

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)

Copy link

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

Housekeeping change to align Kotlin coroutine APIs with Flow best practices by removing suspend from functions that return Flow, updating implementations and tests accordingly across infra, feature, and fingerprint scanner modules.

Changes:

  • Removed suspend from multiple Flow-returning repository/use-case/controller APIs (e.g., matching, events, scanner OTA).
  • Refactored implementations to build cold flows via flow { emitAll(...) } / flowOn(...) rather than suspending up front.
  • Updated unit tests to use every/verify and to collect flows where execution is now collection-driven.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
testing/data-generator/src/test/java/com/simprints/feature/datagenerator/events/InsertSessionEventsUseCaseTest.kt Updates mocking for non-suspend Flow API (every vs coEvery).
infra/sync/src/test/java/com/simprints/infra/sync/usecase/ObserveSyncableCountsUseCaseTest.kt Updates mocks/verifications for non-suspend Flow-returning repository calls.
infra/matching/src/main/java/com/simprints/infra/matching/usecase/MatcherUseCase.kt Removes suspend from matcher Flow API.
infra/matching/src/main/java/com/simprints/infra/matching/usecase/FingerprintMatcherUseCase.kt Aligns implementation signature with non-suspend Flow API.
infra/matching/src/main/java/com/simprints/infra/matching/usecase/FaceMatcherUseCase.kt Aligns implementation signature with non-suspend Flow API.
infra/events/src/test/java/com/simprints/infra/events/event/local/EventLocalDataSourceTest.kt Collects flows to trigger execution after APIs became cold/non-suspend.
infra/events/src/test/java/com/simprints/infra/events/EventRepositoryImplTest.kt Updates mocking/verifications for non-suspend Flow methods.
infra/events/src/main/java/com/simprints/infra/events/event/local/EventLocalDataSource.kt Refactors Room flow wrapper to non-suspend and uses flow/emitAll/flowOn; makes loadAllEvents() cold.
infra/events/src/main/java/com/simprints/infra/events/EventRepositoryImpl.kt Removes suspend from Flow-returning repository methods.
infra/events/src/main/java/com/simprints/infra/events/EventRepository.kt Updates interface to expose Flow-returning methods as non-suspend.
infra/event-sync/src/test/java/com/simprints/infra/eventsync/sync/up/workers/EventUpSyncUploaderWorkerTest.kt Updates mocking for non-suspend Flow method.
fingerprint/infra/scanner/src/test/java/com/simprints/fingerprint/infra/scanner/v2/scanner/ota/un20/Un20OtaControllerTest.kt Ensures OTA flow is collected; adds early-cancel coverage.
fingerprint/infra/scanner/src/test/java/com/simprints/fingerprint/infra/scanner/v2/scanner/ota/stm/StmOtaControllerTest.kt Adds early-cancel coverage for STM OTA flow.
fingerprint/infra/scanner/src/test/java/com/simprints/fingerprint/infra/scanner/v2/scanner/ota/cypress/CypressOtaControllerTest.kt Adds early-cancel coverage for Cypress OTA flow.
fingerprint/infra/scanner/src/test/java/com/simprints/fingerprint/infra/scanner/v2/scanner/ScannerTest.kt Updates mocks/verifications for non-suspend OTA APIs.
fingerprint/infra/scanner/src/test/java/com/simprints/fingerprint/infra/scanner/helpers/Un20OtaHelperTest.kt Updates mocking for non-suspend Flow API.
fingerprint/infra/scanner/src/test/java/com/simprints/fingerprint/infra/scanner/helpers/StmOtaHelperTest.kt Updates mocking for non-suspend Flow API.
fingerprint/infra/scanner/src/test/java/com/simprints/fingerprint/infra/scanner/helpers/CypressOtaHelperTest.kt Updates mocking for non-suspend Flow API.
fingerprint/infra/scanner/src/main/java/com/simprints/fingerprint/infra/scanner/v2/scanner/ota/un20/Un20OtaController.kt Removes suspend from program(); wraps OTA into a cold flow.
fingerprint/infra/scanner/src/main/java/com/simprints/fingerprint/infra/scanner/v2/scanner/ota/stm/StmOtaController.kt Removes suspend from program(); wraps OTA into a cold flow.
fingerprint/infra/scanner/src/main/java/com/simprints/fingerprint/infra/scanner/v2/scanner/ota/cypress/CypressOtaController.kt Removes suspend from program(); wraps OTA into a cold flow.
fingerprint/infra/scanner/src/main/java/com/simprints/fingerprint/infra/scanner/v2/scanner/Scanner.kt Removes suspend from OTA-start methods returning Flow.
fingerprint/connect/src/main/java/com/simprints/fingerprint/connect/screens/ota/OtaViewModel.kt Refactors internal OTA step builder to a cold flow.
feature/matcher/src/test/java/com/simprints/matcher/screen/MatchViewModelTest.kt Updates mocks/verifications for non-suspend matcher Flow APIs.
feature/external-credential/src/test/java/com/simprints/feature/externalcredential/screens/search/usecase/MatchCandidatesUseCaseTest.kt Updates mocks for non-suspend matcher Flow APIs.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

@alex-vt alex-vt merged commit 58ba956 into main Feb 9, 2026
14 checks passed
@alex-vt alex-vt deleted the task/suspend-flow-cleanup branch February 9, 2026 13:13
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.

2 participants