Skip to main content

touch

Function touch 

Source
pub async fn touch(
    pool: &Pool,
    page_id: i64,
    user_id: i64,
    is_editing: bool,
) -> Result<(), ExecError>
Expand description

UPSERT the heartbeat row for (page_id, user_id) and bump last_seen_at to now. Application-enforced uniqueness — we don’t have a SQL UNIQUE constraint because not every dialect agrees on composite uniqueness syntax. The race window is small enough that the worst-case duplicate row is fine; the GC drops them.

§Errors

Driver / query failures.