docs(gpodder): document session last_seen timestamp's precision should be at least to the second

signup-links
Jef Roosens 2025-03-19 10:55:20 +01:00
parent 705b347775
commit 0bb0c5657a
No known key found for this signature in database
GPG Key ID: 21FD3D77D56BAF49
2 changed files with 5 additions and 1 deletions

View File

@ -45,6 +45,8 @@ pub trait AuthStore {
fn insert_user(&self, username: &str, password_hash: &str) -> Result<User, AuthErr>;
/// 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

View File

@ -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(),
};