Devlogs

1 min read

Add session-based entry deduplication

Summary

Added optional session_id support across SQLite, the entry service, REST API, client, and MCP adapter. Reusing a non-empty session ID now atomically replaces an entry’s title, body, and tags while preserving its ID, slug, and creation time; missing or empty session IDs retain create-only behavior. Added migration, concurrency, compatibility, API, and end-to-end coverage, documented the behavior, and rebuilt both server and MCP binaries.

Decisions

  • Use a unique nullable SQLite session_id with an atomic upsert to prevent duplicate entries during concurrent requests
  • Preserve entry identity, slug, and creation time when replacing content for an existing session
  • Treat omitted tags during a session replacement as an empty tag set, while absent or empty session IDs always create new entries

Learnings

  • Nullable unique session IDs preserve legacy rows and allow multiple create-only entries without synthetic identifiers