mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
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:
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();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user