Closed Bug 1318013 Opened 9 years ago Closed 9 years ago

Service Worker clients.matchAll() fails on Android when Fennec is killed

Categories

(Core :: DOM: Service Workers, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: droeh, Unassigned)

Details

When Fennec is killed (eg by swiping from the app switcher), clients.matchAll() returns an empty list even when there are clients it should return. STR: (1) Go to https://serviceworke.rs/push-clients_demo.html in Fennec, hit the 'Send notification' button (2) Kill Fennec (3) When the notification arrives, the message indicates that the page has been closed (and openWindow will be called when you tap the notification) Expected behavior: The notification indicates the page hasn't been closed, and tapping calls focus As far as I can tell from adding a bunch of logging, what's happening is that we're creating a new ServiceWorkerManager when the notification arrives, and using that ServiceWorkerManager's mControlledDocuments for the MatchAll. As for why that's happening, I'm not yet sure.
Ben, snorp said you might be able to offer some advice on this. I'm still continuing to investigate, but any help would be much appreciated.
Flags: needinfo?(bkelly)
Why do you think `clients.matchAll()` should return a reference to a page that has been closed? Unless fennec does something to actually revive the page SWM won't know anything about it. By the way, I just tested this in chrome on android and get the same behavior.
Flags: needinfo?(bkelly)
Google has expressed interest in creating the concept of a "suspended page" that could should up in `clients.matchAll()`, but we've been resistant to adding new states without reason. Maybe we do need it for mobile. Alternatively, we could make `openWindow()` restore the "previously open but unloaded" tab if the URL matches. This would be a fennec specific heuristic, though.
Right, so it turns out the problem was that snorp and I were misunderstanding each other about what was actually happening here -- you're right that the current behavior is correct, Ben. Thanks for your help.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.