Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/tribalmemory/services/episode_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,28 @@ def close_episode(self, episode_id: str) -> Episode:

return self.get_episode(episode_id)

def set_updated_at(self, episode_id: str, updated_at: str) -> None:
"""Set the updated_at timestamp for an episode.

Test helper for simulating stale episodes without breaking
encapsulation by accessing private SQLite connections.

Args:
episode_id: Episode UUID.
updated_at: ISO-8601 timestamp string.

Raises:
ValueError: If episode not found.
"""
with self._lock:
cursor = self._conn.execute(
"UPDATE episodes SET updated_at = ? WHERE id = ?",
(updated_at, episode_id)
)
self._conn.commit()
if cursor.rowcount == 0:
raise ValueError(f"Episode {episode_id} not found")

def delete_episode(self, episode_id: str) -> bool:
"""Delete an episode.

Expand Down
Loading