From 0bb0c5657a1c4ad86115498da20fac4ac33cd87f Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Wed, 19 Mar 2025 10:55:20 +0100 Subject: [PATCH] docs(gpodder): document session last_seen timestamp's precision should be at least to the second --- gpodder/src/store.rs | 2 ++ gpodder_sqlite/tests/auth_test.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gpodder/src/store.rs b/gpodder/src/store.rs index d4df180..800a95d 100644 --- a/gpodder/src/store.rs +++ b/gpodder/src/store.rs @@ -45,6 +45,8 @@ pub trait AuthStore { fn insert_user(&self, username: &str, password_hash: &str) -> Result; /// Create a new session for a user with the given session ID + /// + /// The `last_seen` timestamp's precision should be at least accurate to the second fn insert_session(&self, session: &Session) -> Result<(), AuthErr>; /// Remove the session with the given session ID diff --git a/gpodder_sqlite/tests/auth_test.rs b/gpodder_sqlite/tests/auth_test.rs index b35f2c1..5dd26f4 100644 --- a/gpodder_sqlite/tests/auth_test.rs +++ b/gpodder_sqlite/tests/auth_test.rs @@ -1,5 +1,6 @@ mod common; +use chrono::SubsecRound; use gpodder::{AuthStore, Session}; use gpodder_sqlite::SqliteRepository; @@ -34,7 +35,8 @@ fn test_create_session() { let new_session = Session { id: 123, - last_seen: chrono::Utc::now(), + // + last_seen: chrono::Utc::now().trunc_subsecs(0), user: users[0].clone(), };