ext-menus.js doesn't properly call withLastError (null instead of caller)
Categories
(WebExtensions :: General, defect, P3)
Tracking
(firefox87 fixed)
| Tracking | Status | |
|---|---|---|
| firefox87 | --- | fixed |
People
(Reporter: mkaply, Assigned: digitalsimboja, Mentored)
References
Details
(Keywords: good-first-bug)
Attachments
(2 files, 1 obsolete file)
ext-menus.js calls withLastError explicitly with a null instead of a caller:
As a result, you can't trace errors in adding menus back from where they came from
Per kmag:
John-Galt
It can probably just pass context.getCaller()
John-Galt
And maybe withLastError should assert that caller is not null :/
Updated•2 years ago
|
Comment 1•8 months ago
|
||
To fix this bug, save context.getCaller() in a variable at the start of the create method and pass that value instead of null.
Hi Rob, I'm an Outreachy applicant. Can I fix this bug? Thank you.
Updated•8 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Comment 6•6 months ago
|
||
Hi italo! Just checking in since we haven't heard from you in awhile. How's it going with this bug? Is there anything we can do to help you get unstuck?
Comment 7•4 months ago
|
||
Cleared needinfo and assignee because of patch stale for longer than a month.
| Assignee | ||
Comment 8•4 months ago
|
||
Hello,
I am new to Open Source and would like to take on this bug if it is still open and unassigned.
can I work on it?
I would appreciate all guidance.
Thanks
Comment 9•4 months ago
|
||
Hi Sunday, go for it! You can find tips for getting started at https://wiki.mozilla.org/WebExtensions/Contribution_Onramp. Rob also describes how to fix the bug in comment #1. :)
Feel free to share your patch as soon as you would like some feedback! We'll assign the bug to you once you have the patch up.
| Assignee | ||
Comment 10•4 months ago
|
||
Alright, I am taking it on
| Assignee | ||
Comment 11•4 months ago
|
||
Dear Rob,
I am trying to work on the bug but yet to reproduce the error on my local machine.
Could you direct me if I am mistaking something when I ran the test
./mach test browser/components/extensions/test/browser/browser_ext_menus.js
I could not trace out the error on the output. Kindly point me to the right tests to use so I can be in the right track.
However, I am going over the web extension documentation.
Thanks and appreciate
Comment 12•4 months ago
|
||
There are no existing unit tests for this bug. A previous contributor has started a patch at https://phabricator.services.mozilla.com/D93290?id=356450 which shows the correct logic in the test, but I added some review comments that have not been addressed.
To reproduce locally and manually (in the browser), outside of a unit test:
- Load an extension with the menus permission.
- Open the global Browser Console (Ctrl-Shift-J).
- Call the
browser.menus.createAPI with invalid parameters (e.g. by creating a menu with the same ID twice, like the linked unit test does). - Look at the global browser console, and see if there is a useful stack trace associated with the printed error (
Unchecked lastError value: ID already exists: ...")
(currently, there is no useful stack trace that references the extension file; the desired result is that there is)
| Assignee | ||
Comment 13•4 months ago
|
||
Updated•4 months ago
|
| Assignee | ||
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
| Assignee | ||
Updated•4 months ago
|
Comment 14•4 months ago
|
||
When you update the patch, I'll automatically be notified. There is no need to use needinfo too. It results in two extra emails on top of the one that I get from Phabricator.
| Assignee | ||
Comment 15•4 months ago
|
||
Okay noted
| Assignee | ||
Comment 16•4 months ago
|
||
Dear Rob,
Just to let you know that I am applying for this round of Outreachy. I would love to hear if you are planning on proposing a project. I will be very glad to make contributions on your Outreachy project. For this particular bug fix, I shall be sending my unit test with your revisions tonight.
Comment 17•4 months ago
|
||
I am currently mentoring an Outreachy project, but am not planning to participate in the next round.
| Assignee | ||
Comment 18•4 months ago
|
||
I have updated the patch.
Okay I would appreciate if you know of mentors participating so I can also get in touch with them
Thanks
| Assignee | ||
Comment 19•4 months ago
|
||
I have added your review.
Please check.
Thanks
Comment 20•4 months ago
|
||
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/ea9a50dbf12f Test case added Fix ext-menus.js to call withLastError with caller r=robwu
Comment 21•4 months ago
|
||
Backed out for causing xpcshell failures in test_ext_menu_caller.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/08ca0cd0024ee299579849d9a14b5e19e21e33b0
Failure log: https://treeherder.mozilla.org/logviewer?job_id=329331725&repo=autoland&lineNumber=1931
| Assignee | ||
Comment 22•4 months ago
|
||
Dear Rob,
My attention is drawn to this test by one of the contributors
https://treeherder.mozilla.org/logviewer?job_id=329331725&repo=autoland&lineNumber=1931
Seems the test failed on Andriod. Is this a device restriction? How do I proceed to resolve this?
I appreciate all guides.
Thanks
| Assignee | ||
Comment 23•4 months ago
|
||
I have skipped the testcase for Andriod since the menus API isn't yet supported on Firefox for Android based on the compatibility table.
Comment 24•4 months ago
|
||
I'm following both this bug and the Phabricator revision. Since we're already discussing on Phabricator, there is no need for a needinfo here as well, it just results in extra emails (and some noise here). Comments about the implementation direction can be posted on the Phabricator revision.
Comment 25•4 months ago
|
||
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/3b9a479c0705 Test case added Fix ext-menus.js to call withLastError with caller r=robwu
Comment 26•4 months ago
|
||
| bugherder | ||
Comment 27•4 months ago
|
||
Congrats on landing this patch, Sunday! 🎉 Your contribution has been added to our recognition wiki at https://wiki.mozilla.org/Add-ons/Contribute/Recognition.
Welcome onboard, and good luck with your Outreachy application! While the Add-ons Team isn't running any projects for the upcoming round, you may want to take a look at other projects Mozilla is sponsoring. They are listed on the Outreachy website. :)
Description
•