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

Throw exception when Performance custom trace API is provided with non-positive startTime or duration #3866

Merged
merged 2 commits into from
Oct 2, 2020

Conversation

zijianjoy
Copy link
Contributor

It is common for developer to provide 0 or invalid value for startTime and duration when calling record(startTime, duration, options) to create custom trace. This doesn't create error on the client side, but will be filtered silently during backend processing. Add basic validation to check developer input of both variables on the client side.

@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2020

🦋 Changeset detected

Latest commit: 83fb206

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

This PR includes changesets to release 7 packages
Name Type
@firebase/performance Patch
firebase Patch
@firebase/rules-unit-testing 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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 30, 2020

Binary Size Report

Affected SDKs

  • @firebase/analytics

    Type Base (2be43ea) Head (bbb735f) Diff
    esm2017 18.4 kB 18.6 kB +224 B (+1.2%)
    main 23.3 kB 23.8 kB +467 B (+2.0%)
    module 22.8 kB 23.3 kB +455 B (+2.0%)
  • @firebase/firestore

    Type Base (2be43ea) Head (bbb735f) Diff
    browser 249 kB 249 kB +77 B (+0.0%)
    esm2017 196 kB 196 kB +78 B (+0.0%)
    main 483 kB 484 kB +165 B (+0.0%)
    module 247 kB 247 kB +77 B (+0.0%)
    react-native 196 kB 197 kB +78 B (+0.0%)
  • @firebase/firestore/exp

    Type Base (2be43ea) Head (bbb735f) Diff
    browser 189 kB 189 kB +78 B (+0.0%)
    main 477 kB 477 kB +165 B (+0.0%)
    module 189 kB 189 kB +78 B (+0.0%)
    react-native 189 kB 189 kB +78 B (+0.0%)
  • @firebase/performance

    Type Base (2be43ea) Head (bbb735f) Diff
    browser 27.4 kB 27.8 kB +360 B (+1.3%)
    esm2017 25.4 kB 25.7 kB +356 B (+1.4%)
    main 27.4 kB 27.8 kB +360 B (+1.3%)
    module 27.1 kB 27.5 kB +360 B (+1.3%)
  • firebase

    Type Base (2be43ea) Head (bbb735f) Diff
    firebase-analytics.js 35.8 kB 35.9 kB +70 B (+0.2%)
    firebase-firestore.js 287 kB 287 kB +77 B (+0.0%)
    firebase-performance-standalone.es2017.js 71.3 kB 71.7 kB +313 B (+0.4%)
    firebase-performance-standalone.js 48.0 kB 48.3 kB +321 B (+0.7%)
    firebase-performance.js 38.4 kB 38.7 kB +321 B (+0.8%)
    firebase.js 831 kB 831 kB +470 B (+0.1%)

Test Logs

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 30, 2020

Size Analysis Report

Affected Products

@firebase/performance-exp

  • getPerformance

    Size

    Type Base (2be43ea) Head (bbb735f) Diff
    size 16.8 kB 17.1 kB +317 B (+1.9%)
    size_with_ext_deps 33.8 kB 34.2 kB +319 B (+0.9%)
  • trace

    Size

    Type Base (2be43ea) Head (bbb735f) Diff
    size 16.7 kB 17.1 kB +317 B (+1.9%)
    size_with_ext_deps 33.8 kB 34.1 kB +319 B (+0.9%)

Test Logs

@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2020

Changeset File Check ⚠️

Warning: This PR modifies files in the following packages but they have not been included in the changeset file:

  • @firebase/performance-exp

Make sure this was intentional.

@zijianjoy zijianjoy merged commit 8728e1a into master Oct 2, 2020
@google-oss-bot google-oss-bot mentioned this pull request Oct 6, 2020
@firebase firebase locked and limited conversation to collaborators Nov 2, 2020
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.

None yet

5 participants