Open Bug 1905504 Opened 4 days ago Updated 3 days ago

resetIdleOnEvent should be false for non-background contexts

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

To fix a regression with the event page terminating too early, bug 1851373 added the work-around of not terminating the event page whenever any extension context received an event, which is still part of the source today (resetIdleOnEvent definition).

Back then this was the quickest fix to fix a regression, because the policy back then was to only allow triggered events to keep the event page alive. A few releases later, the implementation was updated to allow any extension API call to keep the event page alive (bug 1844041).

The existence of resetIdleOneEvent = true in too many contexts results in significant overhead (IPC and others, see bug 1830767), and also functional bugs (event page terminating too soon, which I shall report separately). Since we now allow extension API calls to wake up the event page by policy, we should restrict resetIdleOneEvent to event pages only. As part of doing so we should double-check that the event page is kept alive as expected by various extension API calls.

For example, one example that I can think of is extension messaging APIs. Unlike extension API calls, this one does not go through the central recvAPICall handler that resets the idle timeout, but it goes through a separate code path that only calls wakeupBackground to ensure that the event page is kept around. This only wakes up the event page if it was already around, it does nothing if the background is already running.

See Also: → 1905505
Severity: -- → S3
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.