Skip to main content

ensure_session

Function ensure_session 

Source
pub fn ensure_session(content: &str) -> Result<(String, String)>
Expand description

Ensure the document has a session ID. If no frontmatter exists, creates one with a new UUID v4. If frontmatter exists but session is None/null, generates a UUID and sets it. If session already exists, returns as-is. Returns (updated_content, session_id).