Skip to content

Commit

Permalink
🐛 Flip incorrect percentages in error-reporting.js (#40048)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg authored Jun 7, 2024
1 parent f14d0fe commit bba1b5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/error-reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ const ABORTED = 'AbortError';
* them, but we'd still like to report the rough number.
* @const {number}
*/
const NON_ACTIONABLE_ERROR_THROTTLE_THRESHOLD = 0.0001;
const NON_ACTIONABLE_ERROR_THROTTLE_THRESHOLD = 0.9999;

/**
* The threshold for errors throttled because nothing can be done about
* them, but we'd still like to report the rough number.
* @const {number}
*/
const USER_ERROR_THROTTLE_THRESHOLD = 0.01;
const USER_ERROR_THROTTLE_THRESHOLD = 0.99;

/**
* The threshold for reporting errors to the beta error reporting endpoint
Expand All @@ -66,7 +66,7 @@ const REPORT_ERROR_TO_BETA_ENDPOINT_THRESHOLD = 0.1;
* be helpful to notify authors.
* @const {number}
*/
const NON_AMP_JS_ERROR_THRESHOLD = 0.01;
const NON_AMP_JS_ERROR_THRESHOLD = 0.99;

/**
* Throttles reports for the Stable version.
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test-error-reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ describes.sandboxed('getErrorReportData', {}, (env) => {
});

it('should report throttled load errors at threshold', () => {
nextRandomNumber = 0.0001;
nextRandomNumber = 0.9999;
const e = new Error('Failed to load:');
const data = getErrorReportData(
undefined,
Expand All @@ -560,7 +560,7 @@ describes.sandboxed('getErrorReportData', {}, (env) => {
});

it('should report throttled Script errors at threshold', () => {
nextRandomNumber = 0.0001;
nextRandomNumber = 0.9999;
const e = new Error('Script error.');
const data = getErrorReportData(
undefined,
Expand All @@ -574,7 +574,7 @@ describes.sandboxed('getErrorReportData', {}, (env) => {
});

it('should report throttled load errors under threshold', () => {
nextRandomNumber = 0.0001;
nextRandomNumber = 0.9999;
const e = new Error('Failed to load:');
const data = getErrorReportData(
undefined,
Expand Down

0 comments on commit bba1b5c

Please sign in to comment.