Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.9.0"
".": "4.9.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.9.1 (2026-02-06)

Full Changelog: [v4.9.0...v4.9.1](https://github.com/supermemoryai/sdk-ts/compare/v4.9.0...v4.9.1)

### Bug Fixes

* **client:** avoid removing abort listener too early ([d3af18e](https://github.com/supermemoryai/sdk-ts/commit/d3af18e05bbcc085d7fef21dace557bf07011c7b))

## 4.9.0 (2026-02-05)

Full Changelog: [v4.8.0...v4.9.0](https://github.com/supermemoryai/sdk-ts/compare/v4.8.0...v4.9.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supermemory",
"version": "4.9.0",
"version": "4.9.1",
"description": "The official TypeScript library for the Supermemory API",
"author": "Supermemory <dhravya@supermemory.com>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supermemory-mcp",
"version": "4.9.0",
"version": "4.9.1",
"description": "The official MCP Server for the Supermemory API",
"author": "Supermemory <dhravya@supermemory.com>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const newMcpServer = async () =>
new McpServer(
{
name: 'supermemory_api',
version: '4.9.0',
version: '4.9.1',
},
{
instructions: await getInstructions(),
Expand Down
1 change: 0 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ export class Supermemory {
return await this.fetch.call(undefined, url, fetchOptions);
} finally {
clearTimeout(timeout);
if (signal) signal.removeEventListener('abort', abort);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Removing removeEventListener in the finally block causes a memory leak, as listeners on a reused external signal are not cleaned up if the request completes without being aborted.
Severity: HIGH

Suggested Fix

Restore the signal.removeEventListener('abort', abort) call inside the finally block. This ensures the listener is always cleaned up after the request finishes, regardless of whether it was aborted, preventing memory leaks when an AbortSignal is reused.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/client.ts#L596

Potential issue: The removal of `signal.removeEventListener('abort', abort)` from the
`finally` block introduces a memory leak. The `abort` event listener is added to the
external `signal` with the `{ once: true }` option, which only removes the listener
after it fires. If a request completes successfully or times out without the external
signal being aborted, the listener is never removed. When the same `AbortSignal` is
reused across multiple requests, which is a valid pattern, these orphaned listeners
accumulate on the signal object, leading to a memory leak and potentially a
`MaxListenersExceededWarning` in Node.js environments.

Did we get this right? 👍 / 👎 to inform future reviews.

}

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '4.9.0'; // x-release-please-version
export const VERSION = '4.9.1'; // x-release-please-version