feat: add DELETE endpoints for observations (GDPR compliance) #119

Merged
jonas.hanisch merged 2 commits from feat/4-observation-delete-endpoint into main 2026-01-24 11:22:48 +00:00
Owner

Summary

Adds ability to delete observations for privacy/GDPR compliance:

Backend Endpoints:

  • DELETE /api/data/observations/:id - Delete single observation
  • DELETE /api/data/observations - Bulk delete with filters

Bulk Delete Filters:

  • project - Delete all observations for a project
  • sessionId - Delete all observations for a session
  • before - Delete observations before date (ISO format)
  • ids - Delete specific observations by ID (comma-separated)

UI API Client:

  • api.deleteObservation(id) - Delete single observation
  • api.bulkDeleteObservations(params) - Bulk delete with filters

Use Cases

  1. GDPR compliance - Remove client/project-specific data on request
  2. Cleanup - Delete outdated observations
  3. Mistakes - Remove accidentally captured sensitive info
  4. Storage - Reduce database size

Test Plan

  • Test single observation deletion via API
  • Test bulk deletion by project
  • Test bulk deletion by session
  • Test bulk deletion by date
  • Test bulk deletion by ID list
  • Verify safety check (at least one filter required)

Remaining Work (for full #4 completion)

  • CLI commands (claude-mem forget --topic ...)
  • UI for selecting and deleting observations

Partial implementation of #4

🤖 Generated with Claude Code

## Summary Adds ability to delete observations for privacy/GDPR compliance: **Backend Endpoints:** - `DELETE /api/data/observations/:id` - Delete single observation - `DELETE /api/data/observations` - Bulk delete with filters **Bulk Delete Filters:** - `project` - Delete all observations for a project - `sessionId` - Delete all observations for a session - `before` - Delete observations before date (ISO format) - `ids` - Delete specific observations by ID (comma-separated) **UI API Client:** - `api.deleteObservation(id)` - Delete single observation - `api.bulkDeleteObservations(params)` - Bulk delete with filters ## Use Cases 1. **GDPR compliance** - Remove client/project-specific data on request 2. **Cleanup** - Delete outdated observations 3. **Mistakes** - Remove accidentally captured sensitive info 4. **Storage** - Reduce database size ## Test Plan - [ ] Test single observation deletion via API - [ ] Test bulk deletion by project - [ ] Test bulk deletion by session - [ ] Test bulk deletion by date - [ ] Test bulk deletion by ID list - [ ] Verify safety check (at least one filter required) ## Remaining Work (for full #4 completion) - [ ] CLI commands (`claude-mem forget --topic ...`) - [ ] UI for selecting and deleting observations Partial implementation of #4 🤖 Generated with [Claude Code](https://claude.ai/code)
feat: add DELETE endpoints for observations (GDPR compliance)
Some checks failed
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Failing after 35s
CI / validate-plugin (pull_request) Has been skipped
713cb24f33
Adds ability to delete observations for privacy/GDPR compliance:

Backend:
- DELETE /api/data/observations/:id - Delete single observation
- DELETE /api/data/observations - Bulk delete with filters:
  - project: Delete all observations for a project
  - sessionId: Delete all observations for a session
  - before: Delete observations before date (ISO format)
  - ids: Delete specific observations by ID (comma-separated)

UI API client:
- deleteObservation(id) - Delete single observation
- bulkDeleteObservations(params) - Bulk delete with filters

Partial implementation of #4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
jonas.hanisch force-pushed feat/4-observation-delete-endpoint from 713cb24f33
Some checks failed
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Failing after 35s
CI / validate-plugin (pull_request) Has been skipped
to 5f6f6330b0
Some checks failed
CI / check (pull_request) Successful in 1s
CI / build (pull_request) Failing after 1m7s
CI / validate-plugin (pull_request) Has been skipped
2026-01-24 10:39:26 +00:00
Compare
jonas.hanisch force-pushed feat/4-observation-delete-endpoint from 5f6f6330b0
Some checks failed
CI / check (pull_request) Successful in 1s
CI / build (pull_request) Failing after 1m7s
CI / validate-plugin (pull_request) Has been skipped
to 759d43490e
Some checks failed
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Failing after 3s
CI / validate-plugin (pull_request) Has been skipped
2026-01-24 10:50:10 +00:00
Compare
Author
Owner

Build fix applied

The build error was caused by incorrect property name in DateRangeFilter:

  • Changed { before: beforeDate.getTime() } to { end: beforeDate.getTime() } (line 278)
  • Added proper ObservationQueryFilters type import instead of inline type

The DateRangeFilter interface uses start and end, not before.

**Build fix applied** The build error was caused by incorrect property name in `DateRangeFilter`: - Changed `{ before: beforeDate.getTime() }` to `{ end: beforeDate.getTime() }` (line 278) - Added proper `ObservationQueryFilters` type import instead of inline type The `DateRangeFilter` interface uses `start` and `end`, not `before`.
jonas.hanisch force-pushed feat/4-observation-delete-endpoint from 759d43490e
Some checks failed
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Failing after 3s
CI / validate-plugin (pull_request) Has been skipped
to 19df47e940
All checks were successful
CI / check (pull_request) Successful in 1s
CI / build (pull_request) Successful in 47s
CI / validate-plugin (pull_request) Successful in 35s
2026-01-24 11:19:07 +00:00
Compare
jonas.hanisch force-pushed feat/4-observation-delete-endpoint from 19df47e940
All checks were successful
CI / check (pull_request) Successful in 1s
CI / build (pull_request) Successful in 47s
CI / validate-plugin (pull_request) Successful in 35s
to afb93270c1
All checks were successful
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Successful in 34s
CI / validate-plugin (pull_request) Successful in 28s
2026-01-24 11:21:28 +00:00
Compare
jonas.hanisch deleted branch feat/4-observation-delete-endpoint 2026-01-24 11:22:48 +00:00
Sign in to join this conversation.
No description provided.