From be08c0de647365c23e59b5c5e4227b55633bed8f Mon Sep 17 00:00:00 2001 From: Juha Litola Date: Wed, 6 May 2026 09:24:08 +0300 Subject: [PATCH 1/2] fix: close auth callback server after login --- package.json | 2 +- src/commands/login.test.ts | 16 +++++++++++++++- src/commands/login.ts | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8bf15175..f5d66c9e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "githits", "description": "CLI companion for GitHits - code examples from global open source for developers and AI assistants", - "version": "0.4.1", + "version": "0.4.2", "type": "module", "files": [ "dist", diff --git a/src/commands/login.test.ts b/src/commands/login.test.ts index 84d53d79..e90f3d2a 100644 --- a/src/commands/login.test.ts +++ b/src/commands/login.test.ts @@ -395,11 +395,24 @@ describe("loginFlow", () => { it("returns success after completing OAuth flow", async () => { const consoleSpy = spyOn(console, "log").mockImplementation(() => {}); + const close = mock(() => Promise.resolve()); + const authService = createMockAuthService({ + startCallbackServer: mock(() => + Promise.resolve({ + result: Promise.resolve({ + type: "success", + code: "test-code", + state: "test-state", + } as const), + close, + }), + ), + }); const result = await loginFlow( { port: 8080 }, { - authService: createMockAuthService(), + authService, authStorage: createMockAuthStorage(), browserService: createMockBrowserService(), mcpUrl, @@ -408,6 +421,7 @@ describe("loginFlow", () => { expect(result.status).toBe("success"); expect(result.message).toContain("Logged in successfully"); + expect(close).toHaveBeenCalledTimes(1); consoleSpy.mockRestore(); }); diff --git a/src/commands/login.ts b/src/commands/login.ts index 73526a17..5a38f660 100644 --- a/src/commands/login.ts +++ b/src/commands/login.ts @@ -237,6 +237,7 @@ export async function loginFlow( try { callback = await Promise.race([callbackServer.result, timeoutPromise]); if (timeoutId) clearTimeout(timeoutId); + await callbackServer.close().catch(() => {}); } catch (error) { if (timeoutId) clearTimeout(timeoutId); await callbackServer.close().catch(() => {}); From 2fcb3f552f594fb4a1556d3c8d217c1eebfe8299 Mon Sep 17 00:00:00 2001 From: Juha Litola Date: Wed, 6 May 2026 09:31:28 +0300 Subject: [PATCH 2/2] chore: align plugin versions --- .claude-plugin/marketplace.json | 2 +- .claude-plugin/plugin.json | 2 +- .plugin/plugin.json | 2 +- gemini-extension.json | 2 +- plugins/claude/.claude-plugin/plugin.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index c72cc28e..0618d055 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -6,7 +6,7 @@ }, "metadata": { "description": "GitHits plugins for Claude Code - code examples from global open source", - "version": "0.4.1" + "version": "0.4.2" }, "plugins": [ { diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 454af6e9..44b07adc 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "githits", - "version": "0.4.1", + "version": "0.4.2", "description": "Code examples from global open source for developers and AI assistants", "author": { "name": "GitHits" diff --git a/.plugin/plugin.json b/.plugin/plugin.json index 454af6e9..44b07adc 100644 --- a/.plugin/plugin.json +++ b/.plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "githits", - "version": "0.4.1", + "version": "0.4.2", "description": "Code examples from global open source for developers and AI assistants", "author": { "name": "GitHits" diff --git a/gemini-extension.json b/gemini-extension.json index 945b27a0..3be4f8c9 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "githits", - "version": "0.4.1", + "version": "0.4.2", "description": "Code examples from global open source for developers and AI assistants.", "mcpServers": { "githits": { diff --git a/plugins/claude/.claude-plugin/plugin.json b/plugins/claude/.claude-plugin/plugin.json index 454af6e9..44b07adc 100644 --- a/plugins/claude/.claude-plugin/plugin.json +++ b/plugins/claude/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "githits", - "version": "0.4.1", + "version": "0.4.2", "description": "Code examples from global open source for developers and AI assistants", "author": { "name": "GitHits"