Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tolerate missing or falsey substitutions #8907

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jul 3, 2020

Previously the getMessage function would throw if a substitution was falsey. Now it will accept any substitution, including null and undefined.

A substitution of null or undefined will still be reported to Sentry and printed to the console as an error, but it will not interrupt execution. There are a few cases where undefined is shown briefly in-between renders, and we don't want to crash the UI for such a minor problem.

Previously the `getMessage` function would throw if a substitution was
falsey. Now it will accept any substitution, including `undefined`.

A substitution of `null` or `undefined` will still be reported to
Sentry and printed to the console as an error, but it will not
interrupt execution. Any `null` or `undefined` substitutions will be
rendered as empty strings.

Ideally we'd never pass in `null` or `undefined` as a substitution, but
in practice this sometimes just occurs breifly between renders, which
isn't a severe enough problem to justify crashing the UI.

The detection of React component substitutions has been updated as
well, to ensure that `null` values aren't counted as React
substitutions.
@Gudahtt Gudahtt force-pushed the tolerate-missing-substitutions branch from 4b6c484 to fdec151 Compare July 3, 2020 15:13
@Gudahtt Gudahtt marked this pull request as ready for review July 3, 2020 15:13
@Gudahtt Gudahtt requested a review from a team as a code owner July 3, 2020 15:13
@metamaskbot
Copy link
Collaborator

Builds ready [fdec151]
Page Load Metrics (572 ± 46 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint298537157
domContentLoaded3226415709646
load3236425729646
domInteractive3226405709646

@Gudahtt Gudahtt merged commit 564f765 into develop Jul 3, 2020
@Gudahtt Gudahtt deleted the tolerate-missing-substitutions branch July 3, 2020 16:02
@metamaskbot metamaskbot mentioned this pull request Jul 3, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants