Duplicate-login check is too strict: After logging out of seat1, attempting to log into seat0 fails repeatedly with "User already logged in on another seat".
bus_user_logged_in_elsewhere() queries logind's ListSessions to detect duplicate logins. Logind processes the session-end notification (FIFO EOF from session_cleanup()) asynchronously. The false positive could happen if the session teardown takes an unexpectedly long time or never completes due to a bug, or if any child processes fail to exit. Hence the check is very brittle.
Proposed fix:
Replace the logind ListSessions query with a walk of atrium's own seat table, checking other->state == SEAT_SESSION && other->auth.uid == uid. Internal seat state is updated synchronously in session_cleanup(), so the race disappears entirely.
Duplicate-login check is too strict: After logging out of seat1, attempting to log into seat0 fails repeatedly with "User already logged in on another seat".
bus_user_logged_in_elsewhere()queries logind'sListSessionsto detect duplicate logins. Logind processes the session-end notification (FIFO EOF fromsession_cleanup()) asynchronously. The false positive could happen if the session teardown takes an unexpectedly long time or never completes due to a bug, or if any child processes fail to exit. Hence the check is very brittle.Proposed fix:
Replace the logind
ListSessionsquery with a walk of atrium's own seat table, checkingother->state == SEAT_SESSION && other->auth.uid == uid. Internal seat state is updated synchronously insession_cleanup(), so the race disappears entirely.