Skip to content

🐛 Flip incorrect percentages in error-reporting.js #40048

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading