Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: firebase/firebase-js-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: firebase@9.4.1
Choose a base ref
...
head repository: firebase/firebase-js-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: firebase@9.5.0
Choose a head ref
  • 11 commits
  • 100 files changed
  • 10 contributors

Commits on Nov 11, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e34e98e View commit details
  2. Skip IndexedDB cleanup on Safari 15 (#5717)

    * Skip IndexedDB cleanup on Safari 15
    This PR changes our IndexedDB shutdown to skip all remaining work items on Safari 15. It is believed that writing to IndexedDB during unload can trigger a bug on Safari that prevents IndexedDB from loading during the next page load.
    
    * Create lovely-bobcats-punch.md
    cmditch authored Nov 11, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7a5bc84 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    88f2c70 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cf40fb8 View commit details

Commits on Nov 12, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3a94354 View commit details
  2. Merge branch 'release'

    Release 9.4.1
    hsubox76 committed Nov 12, 2021
    Copy the full SHA
    882d864 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    acc5810 View commit details

Commits on Nov 16, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6f0049e View commit details

Commits on Nov 17, 2021

  1. better meta url polyfill (#5738)

    * better meta url polyfill
    
    * Create quick-experts-shave.md
    
    * update
    Feiyang1 authored Nov 17, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ce39a1a View commit details

Commits on Nov 18, 2021

  1. Exclude NodeJS.ReadableStream from compat overloads (#5743)

    * Exclude NodeJS.ReadableStream from compat overloads
    
    * format fix
    
    * Add changeset
    hsubox76 authored Nov 18, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0394cc9 View commit details

Commits on Nov 19, 2021

  1. Version Packages (#5742)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    google-oss-bot and github-actions[bot] authored Nov 19, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb7299c View commit details
Showing with 2,726 additions and 400 deletions.
  1. +7 −1 .github/workflows/{health-metrics-test.yml → health-metrics-pull-request.yml}
  2. +19 −0 .github/workflows/health-metrics-release.yml
  3. +12 −2 common/api-review/storage.api.md
  4. +2 −2 integration/compat-interop/package.json
  5. +1 −1 integration/firebase/package.json
  6. +2 −2 integration/firestore/package.json
  7. +1 −1 integration/messaging/package.json
  8. +1 −1 packages/analytics-compat/package.json
  9. +1 −1 packages/analytics/package.json
  10. +7 −0 packages/app-check-compat/CHANGELOG.md
  11. +3 −3 packages/app-check-compat/package.json
  12. +6 −0 packages/app-check/CHANGELOG.md
  13. +2 −2 packages/app-check/package.json
  14. +13 −4 packages/app-check/src/api.test.ts
  15. +15 −1 packages/app-check/src/api.ts
  16. +5 −0 packages/app-check/src/constants.ts
  17. +5 −2 packages/app-check/src/errors.ts
  18. +73 −3 packages/app-check/src/internal-api.test.ts
  19. +81 −49 packages/app-check/src/internal-api.ts
  20. +201 −0 packages/app-check/src/providers.test.ts
  21. +129 −13 packages/app-check/src/providers.ts
  22. +1 −0 packages/app-check/src/state.ts
  23. +6 −0 packages/app-check/src/types.ts
  24. +27 −0 packages/app-check/src/util.ts
  25. +7 −0 packages/app-compat/CHANGELOG.md
  26. +2 −2 packages/app-compat/package.json
  27. +6 −0 packages/app/CHANGELOG.md
  28. +1 −1 packages/app/package.json
  29. +1 −1 packages/auth-compat/package.json
  30. +16 −0 packages/auth/demo/README.md
  31. +1 −0 packages/auth/demo/package.json
  32. +15 −1 packages/auth/demo/src/index.js
  33. +1 −1 packages/auth/package.json
  34. +1 −2 packages/auth/src/model/public_types.ts
  35. +1 −1 packages/database-compat/package.json
  36. +1 −1 packages/database/package.json
  37. +18 −0 packages/firebase/CHANGELOG.md
  38. +9 −9 packages/firebase/package.json
  39. +7 −0 packages/firestore-compat/CHANGELOG.md
  40. +3 −3 packages/firestore-compat/package.json
  41. +8 −0 packages/firestore/CHANGELOG.md
  42. +3 −3 packages/firestore/package.json
  43. +18 −1 packages/firestore/rollup.config.js
  44. +4 −4 packages/firestore/src/local/indexeddb_persistence.ts
  45. +1 −1 packages/functions-compat/package.json
  46. +1 −1 packages/functions/package.json
  47. +1 −1 packages/installations-compat/package.json
  48. +1 −1 packages/installations/package.json
  49. +1 −1 packages/messaging-compat/package.json
  50. +1 −1 packages/messaging/package.json
  51. +1 −1 packages/performance-compat/package.json
  52. +1 −1 packages/performance/package.json
  53. +1 −1 packages/remote-config-compat/package.json
  54. +1 −1 packages/remote-config/package.json
  55. +9 −0 packages/storage-compat/CHANGELOG.md
  56. +3 −3 packages/storage-compat/package.json
  57. +2 −2 packages/storage/.run/All Tests.run.xml
  58. +10 −0 packages/storage/CHANGELOG.md
  59. +2 −2 packages/storage/package.json
  60. +8 −11 packages/storage/src/api.browser.ts
  61. +8 −10 packages/storage/src/api.node.ts
  62. +24 −1 packages/storage/src/api.ts
  63. +19 −4 packages/storage/src/implementation/connection.ts
  64. +32 −33 packages/storage/src/implementation/request.ts
  65. +20 −5 packages/storage/src/implementation/requestinfo.ts
  66. +58 −26 packages/storage/src/implementation/requests.ts
  67. +60 −15 packages/storage/src/platform/browser/connection.ts
  68. +25 −5 packages/storage/src/platform/connection.ts
  69. +117 −47 packages/storage/src/platform/node/connection.ts
  70. +112 −14 packages/storage/src/reference.ts
  71. +9 −9 packages/storage/src/service.ts
  72. +6 −6 packages/storage/src/task.ts
  73. +50 −1 packages/storage/test/browser/blob.test.ts
  74. +2 −2 packages/storage/test/browser/connection.test.ts
  75. +49 −11 packages/storage/test/integration/integration.test.ts
  76. +2 −2 packages/storage/test/{unit → node}/connection.test.ts
  77. +76 −0 packages/storage/test/node/stream.test.ts
  78. +9 −3 packages/storage/test/unit/connection.ts
  79. +2 −2 packages/storage/test/unit/request.test.ts
  80. +14 −3 packages/storage/test/unit/requests.test.ts
  81. +10 −3 packages/storage/test/unit/testshared.ts
  82. +1 −1 packages/template/package.json
  83. +117 −0 repo-scripts/size-analysis/analyze-all-bundles.ts
  84. +2 −2 repo-scripts/size-analysis/bundle-analysis.ts
  85. +0 −44 repo-scripts/size-analysis/bundle-definition-examples/bundle-definition-1.json
  86. +32 −0 repo-scripts/size-analysis/bundle-definitions/analytics.json
  87. +95 −0 repo-scripts/size-analysis/bundle-definitions/app-check.json
  88. +202 −0 repo-scripts/size-analysis/bundle-definitions/auth.json
  89. +256 −0 repo-scripts/size-analysis/bundle-definitions/database.json
  90. +70 −0 repo-scripts/size-analysis/bundle-definitions/firestore-lite.json
  91. +102 −0 repo-scripts/size-analysis/bundle-definitions/firestore.json
  92. +32 −0 repo-scripts/size-analysis/bundle-definitions/functions.json
  93. +33 −0 repo-scripts/size-analysis/bundle-definitions/messaging.json
  94. +32 −0 repo-scripts/size-analysis/bundle-definitions/performance.json
  95. +33 −0 repo-scripts/size-analysis/bundle-definitions/remote-config.json
  96. +220 −0 repo-scripts/size-analysis/bundle-definitions/storage.json
  97. +1 −1 repo-scripts/size-analysis/package.json
  98. +2 −1 scripts/build/create-overloads.ts
  99. +4 −2 scripts/size_report/report_binary_size.ts
  100. +1 −1 scripts/size_report/size_report_helper.ts
Original file line number Diff line number Diff line change
@@ -3,8 +3,14 @@ name: Health Metrics
on: [push, pull_request]

env:
METRICS_SERVICE_URL: ${{ secrets.METRICS_SERVICE_URL }}
GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
# TODO(yifany): parse from git commit history directly
# Reason: actions/checkout@v2 does not always honor ${{ github.event.pull_request.base.sha }},
# therefore "base.sha" sometimes is not the commit that actually gets merged with the
# pull request head commit for CI test.
# See:
# - https://github.com/actions/checkout/issues/27
# - https://github.com/actions/checkout/issues/237
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
NODE_OPTIONS: "--max-old-space-size=4096"

19 changes: 19 additions & 0 deletions .github/workflows/health-metrics-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Health Metrics

on:
push:
tags: ['**']

jobs:
release-diffing:
name: Release Diffing
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
- uses: FirebaseExtended/github-actions/health-metrics/release-diffing@master
with:
repo: ${{ github.repository }}
ref: ${{ github.ref }}
commit: ${{ github.sha }}
14 changes: 12 additions & 2 deletions common/api-review/storage.api.md
Original file line number Diff line number Diff line change
@@ -77,14 +77,15 @@ export class _FirebaseStorageImpl implements FirebaseStorage {
_getAuthToken(): Promise<string | null>;
get host(): string;
set host(host: string);
// Warning: (ae-forgotten-export) The symbol "ConnectionType" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RequestInfo" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Connection" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Request" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_makeRequest<T>(requestInfo: RequestInfo_2<T>, requestFactory: () => Connection, authToken: string | null, appCheckToken: string | null): Request_2<T>;
_makeRequest<I extends ConnectionType, O>(requestInfo: RequestInfo_2<I, O>, requestFactory: () => Connection<I>, authToken: string | null, appCheckToken: string | null): Request_2<O>;
// (undocumented)
makeRequestWithTokens<T>(requestInfo: RequestInfo_2<T>, requestFactory: () => Connection): Promise<T>;
makeRequestWithTokens<I extends ConnectionType, O>(requestInfo: RequestInfo_2<I, O>, requestFactory: () => Connection<I>): Promise<O>;
_makeStorageReference(loc: _Location): _Reference;
get maxOperationRetryTime(): number;
set maxOperationRetryTime(time: number);
@@ -112,6 +113,12 @@ export interface FullMetadata extends UploadMetadata {
updated: string;
}

// @public
export function getBlob(ref: StorageReference, maxDownloadSizeBytes?: number): Promise<Blob>;

// @public
export function getBytes(ref: StorageReference, maxDownloadSizeBytes?: number): Promise<ArrayBuffer>;

// @internal (undocumented)
export function _getChild(ref: StorageReference, childPath: string): _Reference;

@@ -124,6 +131,9 @@ export function getMetadata(ref: StorageReference): Promise<FullMetadata>;
// @public
export function getStorage(app?: FirebaseApp, bucketUrl?: string): FirebaseStorage;

// @public
export function getStream(ref: StorageReference, maxDownloadSizeBytes?: number): NodeJS.ReadableStream;

// Warning: (ae-forgotten-export) The symbol "StorageError" needs to be exported by the entry point index.d.ts
//
// @internal (undocumented)
4 changes: 2 additions & 2 deletions integration/compat-interop/package.json
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@
"test:debug": "karma start --browsers Chrome --auto-watch"
},
"dependencies": {
"@firebase/app": "0.7.8",
"@firebase/app-compat": "0.1.9",
"@firebase/app": "0.7.9",
"@firebase/app-compat": "0.1.10",
"@firebase/analytics": "0.7.4",
"@firebase/analytics-compat": "0.1.5",
"@firebase/auth": "0.19.3",
2 changes: 1 addition & 1 deletion integration/firebase/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
},
"devDependencies": {
"firebase": "9.4.1",
"firebase": "9.5.0",
"@types/chai": "4.2.22",
"@types/mocha": "9.0.0",
"chai": "4.3.4",
4 changes: 2 additions & 2 deletions integration/firestore/package.json
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@
"test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome"
},
"devDependencies": {
"@firebase/app": "0.7.8",
"@firebase/firestore-compat": "0.1.7",
"@firebase/app": "0.7.9",
"@firebase/firestore-compat": "0.1.8",
"@types/mocha": "9.0.0",
"gulp": "4.0.2",
"gulp-filter": "7.0.0",
2 changes: 1 addition & 1 deletion integration/messaging/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"test:manual": "mocha --exit"
},
"devDependencies": {
"firebase": "9.4.1",
"firebase": "9.5.0",
"chai": "4.3.4",
"chromedriver": "94.0.0",
"express": "4.17.1",
2 changes: 1 addition & 1 deletion packages/analytics-compat/package.json
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
"@firebase/app-compat": "0.x"
},
"devDependencies": {
"@firebase/app-compat": "0.1.9",
"@firebase/app-compat": "0.1.10",
"rollup": "2.57.0",
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-typescript2": "0.30.0",
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@firebase/app": "0.7.8",
"@firebase/app": "0.7.9",
"rollup": "2.57.0",
"@rollup/plugin-commonjs": "21.0.0",
"@rollup/plugin-json": "4.1.0",
7 changes: 7 additions & 0 deletions packages/app-check-compat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @firebase/app-check-compat

## 0.2.2

### Patch Changes

- Updated dependencies [[`6f0049e66`](https://github.com/firebase/firebase-js-sdk/commit/6f0049e66064809ae990a2d9461e28b2d6d08d19)]:
- @firebase/app-check@0.5.2

## 0.2.1

### Patch Changes
6 changes: 3 additions & 3 deletions packages/app-check-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebase/app-check-compat",
"version": "0.2.1",
"version": "0.2.2",
"description": "A compat App Check package for new firebase packages",
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
"main": "dist/index.cjs.js",
@@ -34,15 +34,15 @@
"@firebase/app-compat": "0.x"
},
"dependencies": {
"@firebase/app-check": "0.5.1",
"@firebase/app-check": "0.5.2",
"@firebase/logger": "0.3.2",
"@firebase/util": "1.4.2",
"@firebase/component": "0.5.9",
"tslib": "^2.1.0"
},
"license": "Apache-2.0",
"devDependencies": {
"@firebase/app-compat": "0.1.9",
"@firebase/app-compat": "0.1.10",
"rollup": "2.57.0",
"@rollup/plugin-commonjs": "21.0.0",
"@rollup/plugin-json": "4.1.0",
6 changes: 6 additions & 0 deletions packages/app-check/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @firebase/app-check

## 0.5.2

### Patch Changes

- [`6f0049e66`](https://github.com/firebase/firebase-js-sdk/commit/6f0049e66064809ae990a2d9461e28b2d6d08d19) [#5676](https://github.com/firebase/firebase-js-sdk/pull/5676) - Block exchange requests for certain periods of time after certain error codes to prevent overwhelming the endpoint. Start token listener when App Check is initialized to avoid extra wait time on first getToken() call.

## 0.5.1

### Patch Changes
4 changes: 2 additions & 2 deletions packages/app-check/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebase/app-check",
"version": "0.5.1",
"version": "0.5.2",
"description": "The App Check component of the Firebase JS SDK",
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
"main": "dist/index.cjs.js",
@@ -44,7 +44,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@firebase/app": "0.7.8",
"@firebase/app": "0.7.9",
"rollup": "2.57.0",
"@rollup/plugin-commonjs": "21.0.0",
"@rollup/plugin-json": "4.1.0",
17 changes: 13 additions & 4 deletions packages/app-check/src/api.test.ts
Original file line number Diff line number Diff line change
@@ -278,6 +278,9 @@ describe('api', () => {
provider: new ReCaptchaV3Provider(FAKE_SITE_KEY),
isTokenAutoRefreshEnabled: true
});

expect(getState(app).tokenObservers.length).to.equal(1);

const fakeRecaptchaToken = 'fake-recaptcha-token';
const fakeRecaptchaAppCheckToken = {
token: 'fake-recaptcha-app-check-token',
@@ -299,7 +302,7 @@ describe('api', () => {
const unsubscribe1 = onTokenChanged(appCheck, listener1, errorFn1);
const unsubscribe2 = onTokenChanged(appCheck, listener2, errorFn2);

expect(getState(app).tokenObservers.length).to.equal(2);
expect(getState(app).tokenObservers.length).to.equal(3);

await internalApi.getToken(appCheck as AppCheckService);

@@ -312,14 +315,17 @@ describe('api', () => {
expect(errorFn2).to.not.be.called;
unsubscribe1();
unsubscribe2();
expect(getState(app).tokenObservers.length).to.equal(0);
expect(getState(app).tokenObservers.length).to.equal(1);
});

it('Listeners work when using Observer pattern', async () => {
const appCheck = initializeAppCheck(app, {
provider: new ReCaptchaV3Provider(FAKE_SITE_KEY),
isTokenAutoRefreshEnabled: true
});

expect(getState(app).tokenObservers.length).to.equal(1);

const fakeRecaptchaToken = 'fake-recaptcha-token';
const fakeRecaptchaAppCheckToken = {
token: 'fake-recaptcha-app-check-token',
@@ -351,7 +357,7 @@ describe('api', () => {
error: errorFn1
});

expect(getState(app).tokenObservers.length).to.equal(2);
expect(getState(app).tokenObservers.length).to.equal(3);

await internalApi.getToken(appCheck as AppCheckService);

@@ -364,7 +370,7 @@ describe('api', () => {
expect(errorFn2).to.not.be.called;
unsubscribe1();
unsubscribe2();
expect(getState(app).tokenObservers.length).to.equal(0);
expect(getState(app).tokenObservers.length).to.equal(1);
});

it('onError() catches token errors', async () => {
@@ -373,6 +379,9 @@ describe('api', () => {
provider: new ReCaptchaV3Provider(FAKE_SITE_KEY),
isTokenAutoRefreshEnabled: false
});

expect(getState(app).tokenObservers.length).to.equal(0);

const fakeRecaptchaToken = 'fake-recaptcha-token';
stub(reCAPTCHA, 'getToken').returns(Promise.resolve(fakeRecaptchaToken));
stub(client, 'exchangeToken').rejects('exchange error');
16 changes: 15 additions & 1 deletion packages/app-check/src/api.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@ import {
getToken as getTokenInternal,
addTokenListener,
removeTokenListener,
isValid
isValid,
notifyTokenListeners
} from './internal-api';
import { readTokenFromStorage } from './storage';
import { getDebugToken, initializeDebugMode, isDebugMode } from './debug';
@@ -97,6 +98,17 @@ export function initializeAppCheck(

const appCheck = provider.initialize({ options });
_activate(app, options.provider, options.isTokenAutoRefreshEnabled);
// If isTokenAutoRefreshEnabled is false, do not send any requests to the
// exchange endpoint without an explicit call from the user either directly
// or through another Firebase library (storage, functions, etc.)
if (getState(app).isTokenAutoRefreshEnabled) {
// Adding a listener will start the refresher and fetch a token if needed.
// This gets a token ready and prevents a delay when an internal library
// requests the token.
// Listener function does not need to do anything, its base functionality
// of calling getToken() already fetches token and writes it to memory/storage.
addTokenListener(appCheck, ListenerType.INTERNAL, () => {});
}

return appCheck;
}
@@ -123,6 +135,8 @@ function _activate(
newState.cachedTokenPromise = readTokenFromStorage(app).then(cachedToken => {
if (cachedToken && isValid(cachedToken)) {
setState(app, { ...getState(app), token: cachedToken });
// notify all listeners with the cached token
notifyTokenListeners(app, { token: cachedToken.token });
}
return cachedToken;
});
5 changes: 5 additions & 0 deletions packages/app-check/src/constants.ts
Original file line number Diff line number Diff line change
@@ -38,3 +38,8 @@ export const TOKEN_REFRESH_TIME = {
*/
RETRIAL_MAX_WAIT: 16 * 60 * 1000
};

/**
* One day in millis, for certain error code backoffs.
*/
export const ONE_DAY = 24 * 60 * 60 * 1000;
7 changes: 5 additions & 2 deletions packages/app-check/src/errors.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,8 @@ export const enum AppCheckError {
STORAGE_OPEN = 'storage-open',
STORAGE_GET = 'storage-get',
STORAGE_WRITE = 'storage-set',
RECAPTCHA_ERROR = 'recaptcha-error'
RECAPTCHA_ERROR = 'recaptcha-error',
THROTTLED = 'throttled'
}

const ERRORS: ErrorMap<AppCheckError> = {
@@ -52,7 +53,8 @@ const ERRORS: ErrorMap<AppCheckError> = {
'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',
[AppCheckError.STORAGE_WRITE]:
'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',
[AppCheckError.RECAPTCHA_ERROR]: 'ReCAPTCHA error.'
[AppCheckError.RECAPTCHA_ERROR]: 'ReCAPTCHA error.',
[AppCheckError.THROTTLED]: `Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}`
};

interface ErrorParams {
@@ -64,6 +66,7 @@ interface ErrorParams {
[AppCheckError.STORAGE_OPEN]: { originalErrorMessage?: string };
[AppCheckError.STORAGE_GET]: { originalErrorMessage?: string };
[AppCheckError.STORAGE_WRITE]: { originalErrorMessage?: string };
[AppCheckError.THROTTLED]: { time: string; httpStatus: number };
}

export const ERROR_FACTORY = new ErrorFactory<AppCheckError, ErrorParams>(
Loading