Skip to content

Commit e055e90

Browse files
Add assertion IDs that will be included in production log statements for fail and hardAsserts (#8313)
1 parent ed0803a commit e055e90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+955
-188
lines changed

.changeset/odd-wolves-sit.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/firestore": patch
3+
---
4+
5+
Add unique IDs and state information into fatal error messages instead of the generic "unexpected state" message.

packages/firestore/package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"dev": "rollup -c -w",
2121
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
2222
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
23-
"prettier": "prettier --write '*.js' '@(lite|src|test)/**/*.ts' 'test/unit/remote/bloom_filter_golden_test_data/*.json'",
23+
"prettier": "prettier --write '*.js' '@(lite|src|test|scripts)/**/*.ts' 'test/unit/remote/bloom_filter_golden_test_data/*.json'",
2424
"test:lite": "ts-node ./scripts/run-tests.ts --emulator --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
2525
"test:lite:prod": "ts-node ./scripts/run-tests.ts --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
2626
"test:lite:prod:nameddb": "ts-node ./scripts/run-tests.ts --platform node_lite --databaseId=test-db --main=lite/index.ts 'test/lite/**/*.test.ts'",
2727
"test:lite:browser": "karma start --lite",
2828
"test:lite:browser:nameddb": "karma start --lite --databaseId=test-db",
2929
"test:lite:browser:debug": "karma start --browsers=Chrome --lite --auto-watch",
30-
"test": "run-s --npm-path npm lint test:all",
30+
"test": "run-s --npm-path npm lint assertion-id:check test:all",
3131
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all:ci",
3232
"test:all:ci": "run-s --npm-path npm test:browser test:travis test:lite:browser test:browser:prod:nameddb test:lite:browser:nameddb",
3333
"test:all": "run-p --npm-path npm test:browser test:lite:browser test:travis test:minified test:browser:prod:nameddb test:lite:browser:nameddb",
@@ -52,7 +52,11 @@
5252
"api-report:api-json": "rm -rf temp && api-extractor run --local --verbose",
5353
"api-report": "run-s --npm-path npm api-report:main api-report:lite && yarn api-report:api-json",
5454
"doc": "api-documenter markdown --input temp --output docs",
55-
"typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts"
55+
"typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts",
56+
"assertion-id:check": "ts-node scripts/assertion-id-tool.ts --dir=src --check",
57+
"assertion-id:new": "ts-node scripts/assertion-id-tool.ts --dir=src --new",
58+
"assertion-id:list": "ts-node scripts/assertion-id-tool.ts --dir=src --list",
59+
"assertion-id:find": "ts-node scripts/assertion-id-tool.ts --dir=src --find"
5660
},
5761
"exports": {
5862
".": {

packages/firestore/scripts/assertion-id-tool.js

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)