Skip to content

fix(Android + iOS): missleading optional#84

Merged
mrejdak merged 1 commit into
sbaiahmed1:mainfrom
software-mansion-labs:mrejdak/fix-isdevicesecure-signature
Mar 30, 2026
Merged

fix(Android + iOS): missleading optional#84
mrejdak merged 1 commit into
sbaiahmed1:mainfrom
software-mansion-labs:mrejdak/fix-isdevicesecure-signature

Conversation

@mrejdak

@mrejdak mrejdak commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

The ? in the TypeScript type isDeviceSecure?: boolean was misleading. In every resolved response, isDeviceSecure is always a boolean. The only way you don't get it is if the promise rejects entirely (Android exception path), but then you don't get any result object at all.

Summary by CodeRabbit

  • Breaking Changes
    • Device security status in biometric sensor information is now a required field rather than optional in API responses. Applications must ensure they handle this value in all cases.

@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98755249-408d-478a-8cc2-782d998fb061

📥 Commits

Reviewing files that changed from the base of the PR and between 25a0080 and 95b7af1.

📒 Files selected for processing (2)
  • src/NativeReactNativeBiometrics.ts
  • src/index.tsx

📝 Walkthrough

Walkthrough

This PR updates the TypeScript type contracts in two files to make the isDeviceSecure field a required boolean property instead of optional within the biometric sensor information response type. No logic changes or new functionality introduced.

Changes

Cohort / File(s) Summary
Type Definition Updates
src/NativeReactNativeBiometrics.ts, src/index.tsx
Changed isDeviceSecure from optional (isDeviceSecure?: boolean) to required (isDeviceSecure: boolean) in the biometric sensor info response type across both the TurboModule interface and exported type.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • #74: Added isDeviceSecure as an optional field to the sensor availability response; this PR makes that field required.
  • #76: Implements and uses the isDeviceSecure field in native code and type definitions; this PR hardens the contract by requiring the field.

Poem

🐰 No more questions, no more doubt,
isDeviceSecure must ring out!
Once optional, now it stays,
A promise kept, come what may.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: making a misleading optional field (isDeviceSecure) required in TypeScript types to align with runtime behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@mrejdak
mrejdak merged commit 8d595a4 into sbaiahmed1:main Mar 30, 2026
6 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Mar 30, 2026
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.

1 participant