Skip to content

fix(app-check): validate provider name and error on unrecognized values#9106

Open
just1and0 wants to merge 5 commits into
mainfrom
fix/app-check-validate-provider-name
Open

fix(app-check): validate provider name and error on unrecognized values#9106
just1and0 wants to merge 5 commits into
mainfrom
fix/app-check-validate-provider-name

Conversation

@just1and0

@just1and0 just1and0 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Validate React Native Firebase App Check provider names before configuring the native provider.

Previously, unsupported provider names such as appAttestWithDebugProviderFallback could be passed through without a clear JS-side error, leaving native App Check configured without a matching delegate provider and making the resulting App Check behavior difficult to diagnose. This change adds runtime validation for the supported Android and Apple provider names, plus native diagnostic logging if an unknown provider still reaches the native layer.

Supported provider names are now enforced as:

  • Android: debug, playIntegrity
  • Apple: debug, deviceCheck, appAttest, appAttestWithDeviceCheckFallback

Related issues

Release Summary

Validate App Check provider names at initialization and throw a clear error for unsupported Android or Apple provider values.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/**/e2e
    • jest tests added or updated in packages/**/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

Validated the App Check provider-name checks with the focused Jest suite and JS linting.

yarn lint:js
# passed

yarn tests:jest --watchman=false packages/app-check/__tests__/appcheck.test.ts
# Test Suites: 1 passed, 1 total
# Tests: 12 passed, 12 total

git diff --check main...HEAD
# passed
yarn lint:ios:check could not be completed locally due to a formatter tool spawn error: spawn Unknown system error -86.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces validation for React Native Firebase App Check provider names. By enforcing supported provider values at the initialization stage, it prevents misconfigurations that previously resulted in silent failures or difficult-to-debug issues at the native layer. Additionally, it adds diagnostic logging to assist in identifying unsupported provider configurations.

Highlights

  • Provider Name Validation: Added runtime validation for App Check provider names in the JavaScript layer to ensure only supported values are passed to native code.
  • Native Diagnostic Logging: Implemented logging on both Android and iOS to provide feedback when an unknown provider name is encountered at the native level.
  • Test Coverage: Added comprehensive Jest tests to verify validation logic for both Android and Apple platforms.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@just1and0 just1and0 changed the title Fix/app check validate provider name fix(app-check): validate provider name and error on unrecognized values Jul 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces validation for App Check provider names on both Android and Apple platforms, along with corresponding unit tests and native logging for unknown providers. The feedback suggests throwing an IllegalArgumentException on Android when an unknown provider is encountered to prevent a potential runtime crash, and refactoring the unit tests to use Jest's idiomatic expect().not.toThrow() matcher instead of try-catch blocks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/app-check/__tests__/appcheck.test.ts
Comment thread packages/app-check/__tests__/appcheck.test.ts
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.21739% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.86%. Comparing base (a095bd0) to head (119c071).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9106      +/-   ##
============================================
+ Coverage     65.11%   65.86%   +0.75%     
+ Complexity     1833     1832       -1     
============================================
  Files           503      497       -6     
  Lines         39180    38784     -396     
  Branches       5807     5796      -11     
============================================
+ Hits          25510    25543      +33     
+ Misses        12235    11814     -421     
+ Partials       1435     1427       -8     
Flag Coverage Δ
android-native 62.91% <0.00%> (+2.40%) ⬆️
e2e-ts-android 59.64% <33.34%> (+1.46%) ⬆️
e2e-ts-ios 62.72% <27.78%> (-0.07%) ⬇️
e2e-ts-macos 49.99% <35.72%> (+0.01%) ⬆️
ios-native 62.72% <27.78%> (-0.07%) ⬇️
jest 49.95% <93.34%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

1 participant