Skip to content

Commit e600e7b

Browse files
committed
♻️ Short-circuit logout state transition
Not doing this with the other states, because the intention is to eventually store small bits of information about each state on the state objects, e.g: which mailbox was selected, what caused the logout. For `logout`, the first attempt wins and shouldn't be overwritten. For `selected`, the last attempt _should_ win. (That said, commands that affect connection state should be serialized.)
1 parent 5db59fe commit e600e7b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/net/imap.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3797,7 +3797,9 @@ def state_unselected!
37973797
end
37983798

37993799
def state_logout!
3800+
return true if connection_state in [:logout, *]
38003801
synchronize do
3802+
return true if connection_state in [:logout, *]
38013803
@connection_state = ConnectionState::Logout.new
38023804
end
38033805
end

0 commit comments

Comments
 (0)