Skip to content

Conversation

@MadhuMosip
Copy link
Contributor

@MadhuMosip MadhuMosip commented Dec 11, 2025

RCF-1283
Added auto approval packets if the supervisor approval config flag is enabled.
Added quality check with sdk in the packet and showing in UI, depending on the configuration property.

Summary by CodeRabbit

  • New Features

    • SDK-based quality scoring for biometric captures, shown alongside existing MDS quality.
    • Toggle to enable SDK quality checks via configuration.
    • Automatic approval of registrations when supervisor-approval config is disabled.
  • Documentation

    • Added localization for new quality labels in English, Arabic, French, Hindi, Kannada, and Tamil.

✏️ Tip: You can customize this high-level summary in your review settings.

…ag is enable

Signed-off-by: Madhuravas reddy <madhu@mosip.io>
…ends on configure property

Signed-off-by: Madhuravas reddy <madhu@mosip.io>
@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Warning

Rate limit exceeded

@MadhuMosip has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 23 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb2511 and 19cb157.

📒 Files selected for processing (8)
  • android/clientmanager/src/main/java/io/mosip/registration/clientmanager/constant/RegistrationConstants.java (1 hunks)
  • android/clientmanager/src/main/java/io/mosip/registration/clientmanager/repository/GlobalParamRepository.java (1 hunks)
  • assets/l10n/app_ar.arb (1 hunks)
  • assets/l10n/app_en.arb (1 hunks)
  • assets/l10n/app_fr.arb (1 hunks)
  • assets/l10n/app_hi.arb (1 hunks)
  • assets/l10n/app_kn.arb (1 hunks)
  • assets/l10n/app_ta.arb (1 hunks)

Walkthrough

Adds an SDK-based biometric quality-check path, a supervisor-approval config flag with auto-approve behavior, Pigeon/Dart bridge for the new flag, UI support to show SDK quality, and localization entries for MDS/SDK quality across languages.

Changes

Cohort / File(s) Summary
Constants & Repository
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/constant/RegistrationConstants.java, android/clientmanager/src/main/java/io/mosip/registration/clientmanager/repository/GlobalParamRepository.java
Added QUALITY_CHECK_WITH_SDK and SUPERVISOR_APPROVAL_CONFIG_FLAG constants; added getCachedStringQualityCheckWithSdk() accessor in repository.
Android API Bridge
android/app/src/main/java/io/mosip/registration_client/api_services/GlobalConfigSettingsApi.java, pigeon/global_config_settings.dart, lib/platform_android/global_config_service_impl.dart
Added getQualityCheckWithSdk() to Pigeon API and Android implementation; added corresponding Dart GlobalConfigServiceImpl.getQualityCheckWithSdk() with PlatformException handling.
Biometrics Service
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/Biometrics095Service.java
Added optional SDK quality-scoring path under QUALITY_CHECK_WITH_SDK flag, introduced getSDKScore(BiometricsDto) helper, integrates SDK score into BiometricsDto (falls back to device score when unavailable) and raises errors on SDK failures.
Registration Flow
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java
Added auto-approval of registration packet when SUPERVISOR_APPROVAL_CONFIG_FLAG is not set to "Y" (case-insensitive), updating packet status to APPROVED.
UI (Flutter)
lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart
Added isSdkQualityCheckEnabled state, _getSdkQualityCheckStatus() call during init, _getAvgSdkScore() helper, conditional rendering of SDK quality indicator and average SDK score; note: duplicated _getAvgSdkScore() definition observed.
Localization
assets/l10n/app_en.arb, assets/l10n/app_ar.arb, assets/l10n/app_fr.arb, assets/l10n/app_hi.arb, assets/l10n/app_kn.arb, assets/l10n/app_ta.arb
Added mds_quality and sdk_quality translation keys in all listed language ARB files and small trailing-comma adjustments to accommodate new entries.

Sequence Diagram

sequenceDiagram
    participant UI as Flutter Biometric Widget
    participant Dart as GlobalConfigService (Dart)
    participant Pigeon as GlobalConfigSettingsApi (Pigeon)
    participant Repo as GlobalParamRepository
    participant BiometricSvc as Biometrics095Service
    participant SDK as Match SDK

    UI->>Dart: getQualityCheckWithSdk()
    Dart->>Pigeon: getQualityCheckWithSdk()
    Pigeon->>Repo: getCachedStringQualityCheckWithSdk()
    Repo-->>Pigeon: "Y"/"N"/""
    Pigeon-->>Dart: flag
    Dart-->>UI: enable/disable SDK quality UI

    UI->>BiometricSvc: captureBiometric()
    BiometricSvc->>Repo: read QUALITY_CHECK_WITH_SDK
    alt QUALITY_CHECK_WITH_SDK == "Y"
        BiometricSvc->>SDK: getSDKScore(BiometricsDto)
        SDK-->>BiometricSvc: sdkScore / error
        BiometricSvc->>BiometricSvc: set sdkScore in BiometricsDto
    else
        BiometricSvc->>BiometricSvc: use device-reported quality
    end
    BiometricSvc-->>UI: BiometricsDto (contains quality scores)
    UI->>UI: compute avg SDK score and render indicators
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review SDK scoring: Biometrics095Service.java — BIR construction, byte handling, error paths (SBI_RCAPTURE_ERROR).
  • Verify duplicate helper: _getAvgSdkScore() occurrences in biometric_capture_scan_block_portrait.dart.
  • Cross-layer flag propagation: Pigeon ↔ repo ↔ Dart ↔ UI interactions.
  • Confirm registration auto-approve logic and correct use of PacketClientStatus in RegistrationServiceImpl.java.

Poem

🐇 I hopped through flags and scores today,

SDK eyes check faces in a bright new way.
MDS and SDK now dance in a line,
Approvals eased, translations shine.
A tiny rabbit cheers: "Quality looks fine!"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'RCF-1283 Added config properties' is vague and does not clearly convey the specific changes or main objectives of the PR. Use a more descriptive title that captures the primary changes, such as 'Add SDK quality checks and supervisor approval config' or 'Enable configuration-driven packet approval and quality checks'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java (1)

290-294: Pre-existing bug: NPE risk due to incorrect logical operator.

This is outside the scope of this PR, but worth noting: the condition uses || instead of &&. If containerPath is null, the second operand !containerPath.trim().isEmpty() will throw a NullPointerException.

Consider fixing in a follow-up:

-        if (containerPath != null || !containerPath.trim().isEmpty()) {
+        if (containerPath != null && !containerPath.trim().isEmpty()) {
🧹 Nitpick comments (4)
lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart (2)

41-67: Guard async setState and add an explicit return type

The config‑driven SDK flag wiring looks good. Two small robustness tweaks would help:

  • _getSdkQualityCheckStatus currently has an implicit dynamic return type; prefer Future<void> for clarity with async.
  • After the await call, add a if (!mounted) return; check before setState to avoid calling setState on a disposed widget if the screen is closed quickly.

303-319: Avoid recomputing average SDK score and consider “no score” handling

_getAvgSdkScore correctly averages non‑null sdkScore values, but:

  • In the UI you call _getAvgSdkScore() twice (for the text and the color), which re‑loops the list each time. Compute it once into a local final avgSdkScore = _getAvgSdkScore(); and reuse.
  • When there are no SDK scores, you return 0, which is rendered as 0% and treated as below threshold. If “no SDK score available” should be distinguishable from a genuinely low score, consider returning null and showing an “N/A” label or hiding the SDK block in that case.

Also applies to: 412-460

android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/Biometrics095Service.java (2)

147-175: Move flag lookup out of the loop and reconsider hard‑fail on SDK score errors

The SDK score enrichment is wired correctly, but two details are worth adjusting:

  • qualityCheckWithSdk is fetched on every iteration of the for loop. Since it’s a global param, read it once before the loop and reuse the value to avoid repeated repository/cache lookups.
  • When the flag is enabled, any exception in getSDKScore causes the entire RCapture to fail with SBI_RCAPTURE_ERROR. That makes SDK scoring a hard dependency; consider instead logging the failure and proceeding without sdkScore (or setting a sentinel) if the requirement is to keep capture functional even when the SDK path is misconfigured or temporarily broken.

268-302: Simplify getSDKScore until a real SDK quality API is available

This helper currently:

  • Derives biometricType, base64‑decodes bioValue, and builds a BIR via MatchUtil.buildBir, but
  • Ultimately just returns biometricsDto.getQualityScore() and doesn’t use the constructed BIR.

Given the comment that the Android IBioApiV2 doesn’t yet expose a quality API, this extra work adds CPU and potential failure points without affecting the result. Until you actually call a quality API that consumes the BIR, you could:

  • Drop the BIR construction (and potentially the base64 decode + modality conversion), and
  • Implement getSDKScore as a simple passthrough to the device score (optionally after basic null/empty checks).

This keeps the method cheap and reduces the chance of spurious failures when the SDK scoring feature flag is enabled, while still allowing you to expand it later when the Android quality API is available.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d364e7 and d5f6ec4.

📒 Files selected for processing (14)
  • android/app/src/main/java/io/mosip/registration_client/api_services/GlobalConfigSettingsApi.java (1 hunks)
  • android/clientmanager/src/main/java/io/mosip/registration/clientmanager/constant/RegistrationConstants.java (1 hunks)
  • android/clientmanager/src/main/java/io/mosip/registration/clientmanager/repository/GlobalParamRepository.java (1 hunks)
  • android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/Biometrics095Service.java (5 hunks)
  • android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java (2 hunks)
  • assets/l10n/app_ar.arb (1 hunks)
  • assets/l10n/app_en.arb (1 hunks)
  • assets/l10n/app_fr.arb (1 hunks)
  • assets/l10n/app_hi.arb (1 hunks)
  • assets/l10n/app_kn.arb (1 hunks)
  • assets/l10n/app_ta.arb (1 hunks)
  • lib/platform_android/global_config_service_impl.dart (1 hunks)
  • lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart (4 hunks)
  • pigeon/global_config_settings.dart (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java (1)
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/constant/RegistrationConstants.java (1)
  • RegistrationConstants (9-122)
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/repository/GlobalParamRepository.java (1)
android/clientmanager/src/main/java/io/mosip/registration/clientmanager/constant/RegistrationConstants.java (1)
  • RegistrationConstants (9-122)
🔇 Additional comments (11)
assets/l10n/app_hi.arb (1)

335-337: LGTM!

The Hindi translations for the new quality-related keys are properly added with correct JSON syntax.

assets/l10n/app_ar.arb (1)

335-337: LGTM!

The Arabic translations for the new quality-related keys are properly added with correct JSON syntax.

assets/l10n/app_kn.arb (1)

335-337: LGTM!

The Kannada translations for the new quality-related keys are properly added with correct JSON syntax.

assets/l10n/app_fr.arb (1)

335-337: LGTM!

The French translations for the new quality-related keys are properly added with correct JSON syntax.

assets/l10n/app_en.arb (1)

335-337: LGTM!

The English translations for the new quality-related keys are properly added with correct JSON syntax. These serve as the base translations for all other locales.

assets/l10n/app_ta.arb (1)

344-346: Trailing spaces in "mds_quality" and "sdk_quality" are intentional and consistent across all locales.

All six locale files (en, ta, hi, kn, ar, fr) include trailing spaces in both "mds_quality" and "sdk_quality" values. This is a deliberate, consistent design pattern used for UI spacing and does not require changes.

pigeon/global_config_settings.dart (1)

15-16: LGTM!

The new getQualityCheckWithSdk() method follows the established pattern of other async methods in this Pigeon HostApi interface, consistent with getGpsEnableFlag().

android/clientmanager/src/main/java/io/mosip/registration/clientmanager/repository/GlobalParamRepository.java (1)

161-163: LGTM!

The new getCachedStringQualityCheckWithSdk() method follows the established pattern of other cached string getters in this repository (e.g., getCachedStringGpsDeviceEnableFlag()).

android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java (1)

319-325: LGTM!

The auto-approval logic is correctly placed after the registration is persisted. The condition appropriately treats "Y" (case-insensitive) as enabling supervisor approval, with any other value (including null/unconfigured) resulting in auto-approval.

android/app/src/main/java/io/mosip/registration_client/api_services/GlobalConfigSettingsApi.java (1)

88-98: LGTM!

The new getQualityCheckWithSdk() method correctly follows the established pattern of getGpsEnableFlag(), with appropriate error handling and logging.

android/clientmanager/src/main/java/io/mosip/registration/clientmanager/constant/RegistrationConstants.java (1)

120-121: New global param keys look consistent

The added constants follow the existing naming and namespacing pattern and are safe to use across services and UI.

Signed-off-by: Madhuravas reddy <madhu@mosip.io>
Signed-off-by: Madhuravas reddy <madhu@mosip.io>
Comment on lines +299 to +301
// Current IBioApiV2 does not expose a quality API on Android; fall back to
// the device-reported quality score to keep sdkScore populated.
return biometricsDto.getQualityScore();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Implementation is not complete!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants