Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(desktop): wait for the macOS app signature before signing the extension

tianma-if7d5d7272e8e4
diff --git a/apps/desktop/scripts/sign-share-extension.cjs b/apps/desktop/scripts/sign-share-extension.cjs
index b22f11b9..54300831 100644
--- a/apps/desktop/scripts/sign-share-extension.cjs
+++ b/apps/desktop/scripts/sign-share-extension.cjs
@@ -4,7 +4,8 @@ const { createRequire } = require("node:module");
const { join } = require("node:path");
const builderRequire = createRequire(require.resolve("electron-builder/package.json"));
-const { sign } = builderRequire("@electron/osx-sign");
+// `sign` is the legacy callback API and returns before signing finishes.
+const { signApp } = builderRequire("@electron/osx-sign");
const codesign = (args) => {
const result = spawnSync("codesign", args, { encoding: "utf8" });
@@ -23,7 +24,7 @@ const signingIdentity = (identity) => {
// This replaces mac.sign so the share extension is Developer ID signed, timestamped,
// and hardened before notarization. The outer app is sealed again afterwards.
module.exports = async function signMacApp(opts) {
- await sign(opts);
+ await signApp(opts);
const appexPath = join(opts.app, "Contents", "PlugIns", "EdgeEverShare.appex");
if (!existsSync(appexPath)) {
throw new Error(`macOS share extension is missing from the app bundle: ${appexPath}`);
diff --git a/scripts/desktop-build-workflow.test.mjs b/scripts/desktop-build-workflow.test.mjs
index fe930b74..13227c8a 100644
--- a/scripts/desktop-build-workflow.test.mjs
+++ b/scripts/desktop-build-workflow.test.mjs
@@ -32,7 +32,8 @@ describe("desktop release workflow", () => {
expect(desktopBuilderConfig).toContain("sign: ./scripts/sign-share-extension.cjs");
expect(desktopBuilderConfig).not.toContain("afterSign:");
const shareSigner = readFileSync(new URL("../apps/desktop/scripts/sign-share-extension.cjs", import.meta.url), "utf8");
- expect(shareSigner).toContain("await sign(opts)");
+ expect(shareSigner).toContain("await signApp(opts)");
+ expect(shareSigner).not.toContain("await sign(opts)");
expect(shareSigner).toContain('"runtime"');
expect(shareSigner).toContain('"--timestamp"');
});