Closed Bug 1551612 Opened 5 months ago Closed 5 months ago

Add componentDidCatch handler in Message component

Categories

(DevTools :: Console, task, P1)

task

Tracking

(firefox69 fixed)

RESOLVED FIXED
Firefox 69
Tracking Status
firefox69 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

When the Message component throws, we should render an informative message saying that there was an issue rendering the message and inviting the user to file a bug about it.
We could have a button to copy the message data to the clipboard so the user can provide additional data that would help fixing the bug.

This patch adds a componentDidCatch handler to the Message component
so we don't crash the whole console when a message can't be rendered.
When a message causes a crash, we display an error message instead,
asking the user to file a bug. A button allow to copy the message data
so it can be attached in the bug report.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
See Also: → 1549388
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e2af0f70828c
Add componentDidCatch in Message component. r=bgrins.

Backed out changeset e2af0f70828c for causing bc failures in webconsole.properties

Backout link: https://hg.mozilla.org/integration/autoland/rev/202fecd1adfd61d0ef651c2229bd39c89c181f5e

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=pending%2Crunning%2Ctestfailed%2Cbusted%2Cexception&revision=e2af0f70828c3ff4f70bc12e70cf2a299fab5ad9&selectedJob=250626664

https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=7fc2d7c0c63475c81858df677d52745417b8207d&selectedJob=250622511

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=250622511&repo=autoland&lineNumber=2251

15:27:39 INFO - TEST-START | browser/base/content/test/static/browser_misused_characters_in_strings.js
15:27:39 INFO - TEST-INFO | started process screenshot
15:27:39 INFO - TEST-INFO | screenshot: exit 0
15:27:39 INFO - Buffered messages logged at 15:27:39
15:27:39 INFO - Entering test bound checkAllTheProperties
15:27:39 INFO - TEST-PASS | browser/base/content/test/static/browser_misused_characters_in_strings.js | Found 147 .properties files to scan for misused characters -
15:27:39 INFO - Buffered messages finished
15:27:39 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/static/browser_misused_characters_in_strings.js | jar:file:///Z:/task_1559917967/build/application/firefox/browser/omni.ja!/chrome/en-US/locale/en-US/devtools/client/webconsole.properties with key=webconsole.message.componentDidCatch.label has a misused apostrophe. Strings with apostrophes should use foo’s instead of foo's. -
15:27:39 INFO - Stack trace:
15:27:39 INFO - chrome://mochikit/content/browser-test.js:test_ok:1313
15:27:39 INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_misused_characters_in_strings.js:testForError:123
15:27:39 INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_misused_characters_in_strings.js:testForErrors:128
15:27:39 INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_misused_characters_in_strings.js:checkAllTheProperties:160
15:27:39 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1115
15:27:39 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1143
15:27:39 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1004
15:27:39 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:803
15:27:39 INFO - Not taking screenshot here: see the one that was previously logged
15:27:39 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/static/browser_misused_characters_in_strings.js | jar:file:///Z:/task_1559917967/build/application/firefox/browser/omni.ja!/chrome/en-US/locale/en-US/devtools/client/webconsole.properties with key=webconsole.message.componentDidCatch.label has a misused single-quote. Single-quoted strings should use Unicode ‘foo’ instead of 'foo'. -
15:27:39 INFO - Stack trace:
15:27:39 INFO - chrome://mochikit/content/browser-test.js:test_ok:1313
15:27:39 INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_misused_characters_in_strings.js:testForError:123
15:27:39 INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_misused_characters_in_strings.js:testForErrors:130
15:27:39 INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_misused_characters_in_strings.js:checkAllTheProperties:160
15:27:39 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1115
15:27:39 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1143
15:27:39 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1004
15:27:39 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:803
15:27:39 INFO - Leaving test bound checkAllTheProperties
15:27:39 INFO - Entering test bound checkAllTheDTDs
15:27:39 INFO - TEST-PASS | browser/base/content/test/static/browser_misused_characters_in_strings.js | Found 55 .dtd files to scan for misused characters -

Flags: needinfo?(nchevobbe)

Not using the proper character

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/406aa9e6a102
Add componentDidCatch in Message component. r=bgrins.
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.