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 throttling for App Check to prevent unnecessary requests to backend #6439

Merged
merged 4 commits into from
Jul 18, 2022

Conversation

dwyfrequency
Copy link
Contributor

Switch check for FirebaseError code to use includes #6373

@changeset-bot
Copy link

changeset-bot bot commented Jul 15, 2022

🦋 Changeset detected

Latest commit: 0efea24

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 Patch
@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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 15, 2022

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 15, 2022

Size Report 1

Affected Products

  • @firebase/app-check

    TypeBase (39f4635)Merge (f8c9c90)Diff
    browser25.1 kB25.2 kB+92 B (+0.4%)
    esm529.8 kB29.9 kB+92 B (+0.3%)
    main31.0 kB31.1 kB+92 B (+0.3%)
    module25.1 kB25.2 kB+92 B (+0.4%)
  • bundle

    TypeBase (39f4635)Merge (f8c9c90)Diff
    app-check (ReCaptchaEnterpriseProvider)37.6 kB37.6 kB+42 B (+0.1%)
    app-check (ReCaptchaV3Provider)37.5 kB37.6 kB+42 B (+0.1%)
  • firebase

    TypeBase (39f4635)Merge (f8c9c90)Diff
    firebase-app-check-compat.js22.8 kB22.9 kB+70 B (+0.3%)
    firebase-app-check.js90.9 kB91.0 kB+114 B (+0.1%)
    firebase-compat.js794 kB794 kB+70 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/dRjNFFYYOx.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 15, 2022

Size Analysis Report 1

Affected Products

  • @firebase/app-check

    • ReCaptchaEnterpriseProvider

      Size

      TypeBase (39f4635)Merge (f8c9c90)Diff
      size11.0 kB11.1 kB+42 B (+0.4%)
      size-with-ext-deps28.2 kB28.3 kB+42 B (+0.1%)
    • ReCaptchaV3Provider

      Size

      TypeBase (39f4635)Merge (f8c9c90)Diff
      size11.0 kB11.0 kB+42 B (+0.4%)
      size-with-ext-deps28.2 kB28.2 kB+42 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/ZHwdZQJuYM.html

@dwyfrequency dwyfrequency marked this pull request as ready for review July 18, 2022 15:26
@dwyfrequency dwyfrequency requested a review from egilmorez as a code owner July 18, 2022 15:26
@@ -80,7 +80,10 @@ export class ReCaptchaV3Provider implements AppCheckProvider {
this._heartbeatServiceProvider!
);
} catch (e) {
if ((e as FirebaseError).code === AppCheckError.FETCH_STATUS_ERROR) {
console.log({ coder: (e as FirebaseError).code });
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this left over from debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! Good catch. Removing it now

'test error msg',
{ httpStatus: 503 }
)
ERROR_FACTORY.create(AppCheckError.FETCH_STATUS_ERROR, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing the test!

@dwyfrequency dwyfrequency merged commit f36d627 into master Jul 18, 2022
@dwyfrequency dwyfrequency deleted the jd-app-check-issue-6373 branch July 18, 2022 20:32
egilmorez pushed a commit that referenced this pull request Jul 19, 2022
…nd (#6439)

* Switch check for FirebaseError code to use includes

* Add changeset

* Update changeset to a patch

* Remove debugging console.log
@google-oss-bot google-oss-bot mentioned this pull request Jul 19, 2022
@firebase firebase locked and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants