Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix App Check swallowing errors and returning cached token #8824

Conversation

nermeen-mattar
Copy link

@nermeen-mattar nermeen-mattar commented Mar 3, 2025

Summary
The current implementation checks for result.error, but this property does not exist. Instead, errors are stored in result.internalError. This fix ensures that the correct property is checked, preventing silent failures and ensuring proper error handling.
This change ensures that when an error occurs, it is properly surfaced instead of returning a cached token incorrectly.

@nermeen-mattar nermeen-mattar requested review from hsubox76 and a team as code owners March 3, 2025 15:37
Copy link

changeset-bot bot commented Mar 3, 2025

🦋 Changeset detected

Latest commit: 788d332

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/app-check Minor
@firebase/app-check-compat Patch
firebase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

google-cla bot commented Mar 3, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@nermeen-mattar nermeen-mattar requested review from a team as code owners March 3, 2025 19:04
@nermeen-mattar
Copy link
Author

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Unfortunately, I'm unable to sign the CLA because I keep getting a "Server error occurred, please try your request again." message. I've tried different browsers, networks, and devices, but the issue persists.

Screenshot 2025-03-04 at 2 02 15 AM

@nermeen-mattar nermeen-mattar changed the title Fix App Check swallowing errors and returning cached token Fix App Check swallowing errors and returning cached tokenn Mar 4, 2025
@nermeen-mattar nermeen-mattar changed the title Fix App Check swallowing errors and returning cached tokenn Fix App Check swallowing errors and returning cached token Mar 4, 2025
@nermeen-mattar nermeen-mattar force-pushed the fix-app-check-swallows-errors branch 3 times, most recently from cfe795b to 788d332 Compare March 4, 2025 16:55
@nermeen-mattar nermeen-mattar deleted the fix-app-check-swallows-errors branch March 5, 2025 19:16
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