Open Bug 1454406 Opened 6 years ago Updated 2 years ago

cull tabs.onUpdated listeners when they are no longer valid

Categories

(WebExtensions :: General, enhancement, P3)

58 Branch
enhancement

Tracking

(Not tracked)

People

(Reporter: mixedpuppy, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

Attachments

(2 files, 3 obsolete files)

If filtering on tabId or windowId, when those close the listener is essentially useless, we should remove them automatically.
Assignee: nobody → mixedpuppy
Priority: -- → P2
Product: Toolkit → WebExtensions
Assignee: mixedpuppy → nobody
Blocks: 1587876
Priority: P2 → P3

Shane, could you provide some guidance on how to fix this bug?

If this is your first contribution, please see https://wiki.mozilla.org/WebExtensions/Contribution_Onramp for information on how to get started.

Mentor: mixedpuppy

Mentor: mixedpuppy
Flags: needinfo?(mixedpuppy)

Hello Shane, Can you please provide the STR ?

There really is not an STR here, rather we keep a list of listeners, some of which may be specific to a tab or window. We do not remove those listeners when that tab or window closes. So this would be a bit of cleanup. It's an edge case, but probably happens with some addons.

Our listeners are tracked here:

https://searchfox.org/mozilla-central/rev/623de665034eee43a54ff02939b61385ffd5990d/browser/components/extensions/parent/ext-tabs.js#380

We'd probably want a window close listener that releases any of the above tracked listeners if the windowId matches:

https://searchfox.org/mozilla-central/rev/623de665034eee43a54ff02939b61385ffd5990d/toolkit/components/extensions/parent/ext-tabs-base.js#1592

And similar for tab closing, which could listen for TabClose via windowTracker.addListener, releasing any filter with a matching tabId when a tab closes.

Flags: needinfo?(mixedpuppy)

Hi Shane,
Can I work on this if no one else is working on it?
Thanks

Flags: needinfo?(mixedpuppy)

Sorry Harsh, I have been working on this bug for quit some time, i am very soon going to submit a patch for this bug.

Assignee: nobody → aji.yash13
Status: NEW → ASSIGNED

Depends on D63073

By mistake, two useless revisions are created in phabricator, i have edited the dependencies in the phabricator, How does the attached file can be deleted here ?

Mark the revision as "Abandoned" in Phabricator.

@Ajitesh Removing the bug number from Phabricator hides them from the default view, but they still show up under "attachments". If you want to remove the patch, go to Phabricator, scroll down to the comment box, select "Abandoned" in the dropdown and submit the change.

ok, thanks for help

I have abandoned the useless ones, but still its showing under attachments. Are there any way of deleting them from the attachments' section ?

I expect the Phabricator bot to visit this bug and update the attachments. But I wouldn't be surprised if it did not happen due to the removal of the bug numbers from those Phabricator revisions.

To manually hide those attachments, click on Details, click on Edit details at both attachments, check the "obsolete" checkbox and submit the changes.

Attachment #9127085 - Attachment is obsolete: true
Attachment #9127088 - Attachment is obsolete: true
Flags: needinfo?(mixedpuppy)

Hi Ajitesh, thanks for letting other folks work on some bugs. :) I'm going to formally unassign you and open this up for other contributors.

Assignee: aji.yash13 → nobody
Status: ASSIGNED → NEW
Assignee: nobody → aji.yash13
Status: NEW → ASSIGNED

I accidentally created a new revision for my changes. Should I merge both of them or mark one of them as obsolete ?

Flags: needinfo?(mixedpuppy)

(In reply to Ajitesh13 from comment #17)

I accidentally created a new revision for my changes. Should I merge both of them or mark one of them as obsolete ?

If you can merge so prior review comments remain, that is preferable, but otherwise just obsolete.

Flags: needinfo?(mixedpuppy)

Hello Shane, can you please look into https://phabricator.services.mozilla.com/D70796 and verify if the windowTracker part looks good. Similarly i will start working on for tabTracker.

Flags: needinfo?(mixedpuppy)

I have made all the changes, pushed into the Revision https://phabricator.services.mozilla.com/D63075 (which have the prior review comments) and will mark the extra revision as obsolete. I am very sorry for this mistake.

Attachment #9140325 - Attachment is obsolete: true

Hey Ajitest! How's it going with this bug?

Flags: needinfo?(aji.yash13)
Assignee: aji.yash13 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(aji.yash13)
Flags: needinfo?(mixedpuppy)
Assignee: nobody → kernp25
Status: NEW → ASSIGNED
Summary: cull tab.onUpdated listeners when they are no longer valid → cull tabs.onUpdated listeners when they are no longer valid

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: kernp25 → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: