firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

Implement solution to replace error messages with error codes, instead of removing error messages.

Open MarkDuckworth opened this issue 1 year ago • 7 comments

MarkDuckworth avatar Jun 12 '24 17:06 MarkDuckworth

🦋 Changeset detected

Latest commit: 833f972f6680f88aadbb39da62bdca517d480187

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

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat 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

changeset-bot[bot] avatar Jun 12 '24 17:06 changeset-bot[bot]

Changeset File Check :white_check_mark:

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

github-actions[bot] avatar Jun 12 '24 17:06 github-actions[bot]

Size Report 1

Affected Products

  • @firebase/data-connect

    TypeBase (933ba9d)Merge (8d4a221)Diff
    browser21.4 kB21.4 kB+5 B (+0.0%)
    main23.6 kB23.7 kB+51 B (+0.2%)
    module21.4 kB21.4 kB+5 B (+0.0%)
  • @firebase/firestore

    TypeBase (933ba9d)Merge (8d4a221)Diff
    browser382 kB384 kB+2.48 kB (+0.6%)
    main591 kB594 kB+3.22 kB (+0.5%)
    module382 kB384 kB+2.48 kB (+0.6%)
    react-native382 kB384 kB+2.47 kB (+0.6%)
  • @firebase/firestore-lite

    TypeBase (933ba9d)Merge (8d4a221)Diff
    browser113 kB114 kB+984 B (+0.9%)
    main155 kB157 kB+1.42 kB (+0.9%)
    module113 kB114 kB+984 B (+0.9%)
    react-native113 kB114 kB+984 B (+0.9%)
  • bundle

    15 size changes

    TypeBase (933ba9d)Merge (8d4a221)Diff
    firestore (CSI Auto Indexing Disable and Delete)272 kB274 kB+1.95 kB (+0.7%)
    firestore (CSI Auto Indexing Enable)272 kB274 kB+1.95 kB (+0.7%)
    firestore (Persistence)304 kB306 kB+2.18 kB (+0.7%)
    firestore (Query Cursors)250 kB251 kB+1.31 kB (+0.5%)
    firestore (Query)248 kB249 kB+1.31 kB (+0.5%)
    firestore (Read data once)236 kB237 kB+1.28 kB (+0.5%)
    firestore (Read Write w Persistence)328 kB330 kB+2.24 kB (+0.7%)
    firestore (Realtime updates)238 kB239 kB+1.30 kB (+0.5%)
    firestore (Transaction)215 kB216 kB+1.25 kB (+0.6%)
    firestore (Write data)214 kB216 kB+1.20 kB (+0.6%)
    firestore-lite (Query Cursors)104 kB104 kB+702 B (+0.7%)
    firestore-lite (Query)99.9 kB101 kB+702 B (+0.7%)
    firestore-lite (Read data once)75.4 kB75.9 kB+543 B (+0.7%)
    firestore-lite (Transaction)101 kB101 kB+786 B (+0.8%)
    firestore-lite (Write data)85.0 kB85.5 kB+572 B (+0.7%)
  • firebase

    TypeBase (933ba9d)Merge (8d4a221)Diff
    firebase-compat.js794 kB797 kB+2.42 kB (+0.3%)
    firebase-data-connect.js17.6 kB17.9 kB+358 B (+2.0%)
    firebase-firestore-compat.js340 kB342 kB+2.43 kB (+0.7%)
    firebase-firestore-lite.js131 kB132 kB+984 B (+0.7%)
    firebase-firestore.js440 kB443 kB+2.42 kB (+0.5%)

Test Logs

google-oss-bot avatar Jun 12 '24 19:06 google-oss-bot

IMO adding 2.4 kB to the bundle size is questionable if it's worth it.

dconeybe avatar Jun 12 '24 19:06 dconeybe

Size Analysis Report 1

This report is too large (723,339 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

google-oss-bot avatar Jun 12 '24 19:06 google-oss-bot

IMO adding 2.4 kB to the bundle size is questionable if it's worth it.

@dconeybe, in your opinion, what increase in bundle size would be acceptable?

It's <=1% increase, which seems like a reasonable tradeoff for making production issues more debuggable. But I'm seeing if I can make the impact smaller.

MarkDuckworth avatar Jun 12 '24 19:06 MarkDuckworth

IMO adding 2.4 kB to the bundle size is questionable if it's worth it.

@dconeybe, in your opinion, what increase in bundle size would be acceptable?

It's <=1% increase, which seems like a reasonable tradeoff for making production issues more debuggable. But I'm seeing if I can make the impact smaller.

I'd hope it would be less than 1kB. But this is just one man's opinion. Please don't take it as gospel truth.

dconeybe avatar Jun 12 '24 20:06 dconeybe

Please let the team know about the 1% increase in code bundle size and make sure they're ok with it. The "firestore (Read Write w Persistence)" bundle increased by 2.77 kB which is probably worth it, but I'd make sure the team knows.

Also, please add a change set with a minor version bump and a change log entry.

dconeybe avatar Apr 02 '25 12:04 dconeybe

FWIW I much prefer the "hashes" you had before over error codes numerically incrementing from zero. The reason is that hashes have much better "SEO" because of their uniqueness. Firstly, the improved SEO allows customers to search for the error code and find relevant bug reports, stack overflow posts, etc. If they search for error code "3" they won't likely get anything useful, but if they search for "jszxcbe37k" they'll likely get results that relate directly to the error that they are experiencing. Likewise, when we as Firestore SDK developers get a bug report with error code "3" it's much more difficult to find its place in the source code than searching for "jszxcbe37k".

For Data Connect I chose this alphabet: [23456789abcdefghjkmnopqrstuvwxyz](https://github.com/firebase/firebase-android-sdk/blob/a0a02a73f67f6447c739d920f614c8bd5331c591/firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/util/AlphanumericStringUtil.kt#L31C45-L31C79) (a length of 32). This alphabet is most of the English lowercase letters and most digits, with those that "look alike" removed (e.g. zero "0" and lowercase-o "o"). This leads to incredibly unique 6-digit strings.

dconeybe avatar Apr 03 '25 13:04 dconeybe

Vertex AI Mock Responses Check :warning:

A newer major version of the mock responses for Vertex AI unit tests is available. update_vertexai_responses.sh should be updated to clone the latest version of the responses: v10.0

github-actions[bot] avatar Apr 11 '25 19:04 github-actions[bot]