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

Add assertion IDs that will be included in production log statements for fail and hardAsserts #8313

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
53603f3
Implement solution to replace error messages with error codes, instea…
MarkDuckworth Jun 12, 2024
c7c099a
Try-catch on saveErrorCode
MarkDuckworth Jun 12, 2024
39cf218
Replace string errorCodes with numeric errorIds to make the bundles s…
MarkDuckworth Jun 12, 2024
d441861
Merge branch 'main' of github.com:firebase/firebase-js-sdk into markd…
MarkDuckworth Apr 1, 2025
448257f
Added fixed error code values to source
MarkDuckworth Apr 1, 2025
70dcaa7
Removed 4 characters from each error code
MarkDuckworth Apr 2, 2025
a86219b
Deduplicated an error code
MarkDuckworth Apr 2, 2025
8b7c3f2
Fix tests
MarkDuckworth Apr 2, 2025
26cdf17
Error codes numerically increasing starting at 0 with tools to create…
MarkDuckworth Apr 3, 2025
8e28999
Instructions for using error-code-tool
MarkDuckworth Apr 3, 2025
1733442
Create odd-wolves-sit.md
MarkDuckworth Apr 3, 2025
3a1eaae
Rename error code to assertion id to deter customers from using this …
MarkDuckworth Apr 3, 2025
3803a86
Assertion ID back to 4 digit hex
MarkDuckworth Apr 7, 2025
fef77fb
Updated assertion id tool to use hex string
MarkDuckworth Apr 7, 2025
7416fa2
Merge branch 'markduckworth/error-codes' of github.com:firebase/fireb…
MarkDuckworth Apr 7, 2025
70ebdc3
Update odd-wolves-sit.md
MarkDuckworth Apr 8, 2025
d2ef447
Update odd-wolves-sit.md
MarkDuckworth Apr 8, 2025
4374a98
Address PR feedback
MarkDuckworth Apr 8, 2025
a46a147
Update prettier to run on scripts/ and commit the results of prettier
MarkDuckworth Apr 8, 2025
0607d5b
Merge branch 'markduckworth/error-codes' of github.com:firebase/fireb…
MarkDuckworth Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/odd-wolves-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Add unique IDs and state information into fatal error messages instead of the generic "unexpected state" message.
10 changes: 7 additions & 3 deletions packages/firestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"dev": "rollup -c -w",
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"prettier": "prettier --write '*.js' '@(lite|src|test)/**/*.ts' 'test/unit/remote/bloom_filter_golden_test_data/*.json'",
"prettier": "prettier --write '*.js' '@(lite|src|test|scripts)/**/*.ts' 'test/unit/remote/bloom_filter_golden_test_data/*.json'",
"test:lite": "ts-node ./scripts/run-tests.ts --emulator --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
"test:lite:prod": "ts-node ./scripts/run-tests.ts --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
"test:lite:prod:nameddb": "ts-node ./scripts/run-tests.ts --platform node_lite --databaseId=test-db --main=lite/index.ts 'test/lite/**/*.test.ts'",
"test:lite:browser": "karma start --lite",
"test:lite:browser:nameddb": "karma start --lite --databaseId=test-db",
"test:lite:browser:debug": "karma start --browsers=Chrome --lite --auto-watch",
"test": "run-s --npm-path npm lint test:all",
"test": "run-s --npm-path npm lint assertion-id:check test:all",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all:ci",
"test:all:ci": "run-s --npm-path npm test:browser test:travis test:lite:browser test:browser:prod:nameddb test:lite:browser:nameddb",
"test:all": "run-p --npm-path npm test:browser test:lite:browser test:travis test:minified test:browser:prod:nameddb test:lite:browser:nameddb",
Expand All @@ -52,7 +52,11 @@
"api-report:api-json": "rm -rf temp && api-extractor run --local --verbose",
"api-report": "run-s --npm-path npm api-report:main api-report:lite && yarn api-report:api-json",
"doc": "api-documenter markdown --input temp --output docs",
"typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts"
"typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts",
"assertion-id:check": "ts-node scripts/assertion-id-tool.ts --dir=src --check",
"assertion-id:new": "ts-node scripts/assertion-id-tool.ts --dir=src --new",
"assertion-id:list": "ts-node scripts/assertion-id-tool.ts --dir=src --list",
"assertion-id:find": "ts-node scripts/assertion-id-tool.ts --dir=src --find"
},
"exports": {
".": {
Expand Down
17 changes: 17 additions & 0 deletions packages/firestore/scripts/assertion-id-tool.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading