fix(pwa): clear the leftover app badge from the page, not the worker

A badge call from the service worker stalled Chromium's worker thread
while it activated, awaited or not: the worker reached "activated" but
never claimed its pages, so no page was ever controlled and every
offline path was gone. The worker no longer touches the badge. The
installed app clears a leftover count from the page once the worker is
registered; a browser tab leaves it alone.

The filter-sync test no longer reads `history.length`, which the
browser caps; the recorded push without a replace already proves the
new entry.
This commit is contained in:
Marc-André Bombeck committed 2026-11-12 15:28:37 +01:00
1 parent 45a5d4e353
commit 80ee228899
5 files changed
+61 -18

No files matched your search

@@ -164,12 +164,12 @@ describe("useUrlFilterSync with FilterBar", () => {
it("writes a facet picked from the open menu as a new history entry", async () => {
const { pill, history, pick } = await mount();
const entries = window.history.length;
await pick("Type", "Pulse");
await expectSearch("?type=PULSE");
// A push and no replace is the new entry. `history.length` is no proof:
// the browser caps it, and other files in this frame push entries too.
expect(history.pushes()).toEqual(["?type=PULSE"]);
expect(history.replaces()).toEqual([]);
expect(window.history.length).toBe(entries + 1);
await expect.element(pill("Type: Pulse")).toBeInTheDocument();
});