mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-02 02:11:20 +00:00
#1406 shipped the API-error unwrapping and the status-aware handleError fallbacks with a test file that had already been deleted in #1397, so SupermemoryClient - every outbound API call, extractApiErrorMessage, and all of handleError - had no coverage at all. Restores src/server/client/index.test.ts with 53 cases covering the SDK wiring, space scoping, result normalisation, forgetMemory's exact-match and similarity fallbacks, the raw-fetch endpoints, and the full status table. Two of those cases failed against the untested code: - A 403 whose body is {"error": ""} leaked the raw JSON envelope to the user, because extractApiErrorMessage falls through to the raw string when the recognised key holds an empty value. An envelope we parsed but that carries no message now yields undefined so the caller reaches its scope-aware fallback. - A status outside the mapped switch (409, 413, ...) with an empty body reached the user as an Error with an empty message. Unmapped statuses with no message now report the status instead. |
||
|---|---|---|
| .. | ||
| browser-extension | ||
| docs | ||
| mcp | ||
| memory-graph-playground | ||
| raycast-extension | ||
| web | ||