You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug:
When removing a user from a rotation, the list of users and who is active gets shifted unexpectedly. As a user, I would expect the current on-call person to stay on call.
Steps to Reproduce:
Go to a rotation with a few users
Click on 'Remove user' on someone before the active user
Confirm, and notice the active user shift
Expected Behavior:
Active user does not shift when removing a rotation participant
The text was updated successfully, but these errors were encountered:
Failing inside of updateRotationParticipants when calling updateRotation with a list of userIDs to remove:
if len(userIDs) == 0 {
// Delete rotation state if all users are going to be deleted as per new input
err = m.RotationStore.DeleteStateTx(ctx, tx, rotationID)
if err != nil {
return err
}
} else if updateActive {
// get current active participant
s, err := m.RotationStore.StateTx(ctx, tx, rotationID)
if errors.Is(err, rotation.ErrNoState) {
return nil
}
if err != nil {
return err
}
// if currently active user is going to be deleted
// then set to first user before we actually delete any users
if s.Position >= len(userIDs) {
err = m.RotationStore.SetActiveIndexTx(ctx, tx, rotationID, 0)
if err != nil {
return err
}
}
}
Describe the Bug:
When removing a user from a rotation, the list of users and who is active gets shifted unexpectedly. As a user, I would expect the current on-call person to stay on call.
Steps to Reproduce:
Expected Behavior:
The text was updated successfully, but these errors were encountered: