diff --git a/src/claude_memory/api/app.py b/src/claude_memory/api/app.py index a263fd8..756084b 100644 --- a/src/claude_memory/api/app.py +++ b/src/claude_memory/api/app.py @@ -69,16 +69,17 @@ async def sync_memories( async with pool.acquire() as conn: if since: + since_dt = datetime.fromisoformat(since) rows = await conn.fetch( """ SELECT id, content, category, tags, expanded_keywords, importance, is_sensitive, created_at, updated_at, deleted_at FROM memories - WHERE user_id = $1 AND updated_at > $2::timestamptz + WHERE user_id = $1 AND updated_at > $2 ORDER BY updated_at ASC """, user.user_id, - since, + since_dt, ) else: rows = await conn.fetch( diff --git a/tests/test_api.py b/tests/test_api.py index 88ecfc6..60d4b1f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -349,7 +349,7 @@ async def test_sync_incremental_with_since(client): async with ac: resp = await ac.get( - "/api/memories/sync?since=2026-03-14T10:00:00+00:00", + "/api/memories/sync?since=2026-03-14T10:00:00Z", headers={"Authorization": "Bearer test-key"}, ) @@ -374,7 +374,7 @@ async def test_sync_includes_soft_deleted_with_since(client): async with ac: resp = await ac.get( - "/api/memories/sync?since=2026-03-14T10:00:00+00:00", + "/api/memories/sync?since=2026-03-14T10:00:00Z", headers={"Authorization": "Bearer test-key"}, )