Skip to content

Graph API: PATCH metadata replaces instead of merging #31

Description

@spokV

Context

From PR #28 review.

Problem

Both PATCH endpoints (memora/graph/server.py and memora-graph/functions/api/memories/[id].ts) replace the entire metadata object when metadata is present in the request body, instead of merging with existing keys.

Example: PATCH {"metadata": {"a": 3}} against {"a": 1, "b": 2} drops key b.

Not a problem in normal UI usage (the UI sends the full metadata object), but breaks for direct API callers sending partial updates.

Fix

Merge incoming metadata with existing: merged = { ...existing, ...incoming } (or {**existing, **incoming} in Python).

Files

  • memora/graph/server.py:331
  • memora-graph/functions/api/memories/[id].ts:106

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions