queue fixes and admin force improvements

This commit is contained in:
legop3
2026-06-29 12:00:29 -04:00
parent 368ccf363d
commit 02df826eb4
3 changed files with 162 additions and 23 deletions
@@ -51,7 +51,16 @@ function createRoverLifecycle(deps) {
}
socketToRovers.get(socket.id).add(roverId);
socket.join(record.room);
turnService.driverAdded(roverId, socket.id, (force && isAdmin(socket)) || forceTurn);
const adminForceControl = force && isAdmin(socket);
turnService.driverAdded(roverId, socket.id, {
/*
`forceTurn` is used by private-rover approval to grant a user the next
active slot, but it should not freeze the public turn queue. Only an
explicit admin force-control request is a takeover that pauses rotation.
*/
force: adminForceControl || forceTurn,
pauseQueue: adminForceControl,
});
socket.emit('controlGranted', { roverId });
managerEvents.emit('driver', { socketId: socket.id, roverId, action: 'add' });
sendAlert({