From adf11b20cfed12196078d8eeabe8fcf165f1859c Mon Sep 17 00:00:00 2001 From: callumalpass Date: Mon, 19 Oct 2026 15:55:13 +1100 Subject: [PATCH 1/2] Format Reader grant callback and SDK notes --- apps/reader/src/grant-callback.test.ts | 14 +++++++------- apps/reader/src/grant-callback.ts | 5 +---- docs/new-sdk.md | 1 - 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/reader/src/grant-callback.test.ts b/apps/reader/src/grant-callback.test.ts index 82c9c01..964fc7f 100644 --- a/apps/reader/src/grant-callback.test.ts +++ b/apps/reader/src/grant-callback.test.ts @@ -14,19 +14,19 @@ it("recognises the consent popup's return, approved or declined, and nothing els it("delivers without preempting the original SDK popup lifetime, including failed delivery", async () => { const url = new URL("http://127.0.0.1:48222/?state=s&code=c"); - const close = vi.fn();vi.stubGlobal("window",{close}); + const close = vi.fn(); + vi.stubGlobal("window", { close }); const deliver = vi.fn(); expect(completeAppGrantCallback(url, deliver)).toBe(true); - await new Promise(resolve=>setTimeout(resolve,0)); + await new Promise((resolve) => setTimeout(resolve, 0)); expect(close).not.toHaveBeenCalled(); expect(deliver).toHaveBeenCalledWith(url.href); - expect( - completeAppGrantCallback(url, () => Promise.reject(new Error("no channel"))), - ).toBe(true); - await new Promise(resolve=>setTimeout(resolve,0)); + expect(completeAppGrantCallback(url, () => Promise.reject(new Error("no channel")))).toBe(true); + await new Promise((resolve) => setTimeout(resolve, 0)); expect(close).not.toHaveBeenCalled(); expect(completeAppGrantCallback(new URL("http://127.0.0.1:48222/"), deliver)).toBe(false); - expect(close).not.toHaveBeenCalled();vi.unstubAllGlobals(); + expect(close).not.toHaveBeenCalled(); + vi.unstubAllGlobals(); }); diff --git a/apps/reader/src/grant-callback.ts b/apps/reader/src/grant-callback.ts index 264541a..6274b1a 100644 --- a/apps/reader/src/grant-callback.ts +++ b/apps/reader/src/grant-callback.ts @@ -18,10 +18,7 @@ const deliverWithSdk: Deliver = async (href) => { }; /** Hand the callback to the original SDK owner. False when it is not one. */ -export function completeAppGrantCallback( - url: URL, - deliver: Deliver = deliverWithSdk, -): boolean { +export function completeAppGrantCallback(url: URL, deliver: Deliver = deliverWithSdk): boolean { if (!isAppGrantCallback(url)) { return false; } diff --git a/docs/new-sdk.md b/docs/new-sdk.md index 578b1b3..18337ca 100644 --- a/docs/new-sdk.md +++ b/docs/new-sdk.md @@ -22,7 +22,6 @@ admission, READ/edit/reload or production release qualification. ## Prior intake notes (superseded SDK pin) - Reader is being ported from prod Connect (`@mdbase-dev/connect`) to the public application entry of the new SDK (`@mdbase-dev/sdk`, `MdbaseConnect`). From a92c8bbf8b95e5425632291b67a28c523dab8fb8 Mon Sep 17 00:00:00 2001 From: callumalpass Date: Mon, 19 Oct 2026 16:05:34 +1100 Subject: [PATCH 2/2] Regenerate the production extension declaration baseline --- apps/extension/src/generated/mdbase-app.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/extension/src/generated/mdbase-app.json b/apps/extension/src/generated/mdbase-app.json index a3337fa..627ba33 100644 --- a/apps/extension/src/generated/mdbase-app.json +++ b/apps/extension/src/generated/mdbase-app.json @@ -2,9 +2,9 @@ "manifest_version": 1, "id": "dev.mdbase.reader.extension", "name": "mdbase Reader browser extension", - "homepage": "https://lab.mdbase-reader.pages.dev/", - "icon": "https://lab.mdbase-reader.pages.dev/favicon.svg", - "redirect_uris": ["https://lab.mdbase-reader.pages.dev/"], + "homepage": "https://reader.mdbase.dev/", + "icon": "https://reader.mdbase.dev/favicon.svg", + "redirect_uris": ["https://reader.mdbase.dev/"], "requirements": { "access": "full_collection", "contracts": [ @@ -193,6 +193,6 @@ ] }, "installation_origins": { - "lab": { "app-runtime": ["chrome-extension://kimdfjefhbfgfecconmaiaaindjccidp"] } + "production": { "app-runtime": ["chrome-extension://kimdfjefhbfgfecconmaiaaindjccidp"] } } }