The unit has A as commander and B as deputy
B sends an order for the unit
The unit is reassigned to Y as commander and Z as deputy
A sends an order for the unit
Y sends an order for the unit
Z sends an order for the unit
then B's order is valid, because he is the deputy and the commander hasn't submitted an order yet. A's order is not valid because after the reassignment he's no longer the commander. Y's orders is valid because he is the new commander, and his order as commander displaces B's order, because B was the deputy at the time he submitted his order. Z's orders is valid, but is discarded because he is the deputy and the commander, Y, has already sent orders.
If a commander sends orders, then the unit is reassigned, then the new deputy sends orders, the new deputy's orders will be discarded because the unit has orders from A who was the commander when they were sent. If an old commander has sent orders and they need to be replaced, the new orders must be sent by the new commander, not by the new deputy. If instead the old deputy has sent orders, then either the new commander or the new deputy can send new orders which will replace the old deputy's orders.
Password changes work the same way. If you send an order, change your password, then sent a second order with the new password, both orders are valid. The change of password will not affect orders sent previously but will affect orders sent subsequently. If you change your password, then send an order with the old password, that order is rejected. If you send an order with the old password, then change your password, then the old order will be accepted; the later change of password does not invalidate the order sent earlier with the old password, which was correct when the order was sent.
Because orders are sent by web forms and not by email, there are no
delays in transmission as there can be with email. Orders, assignments,
and password changes will always be received and processed in exactly the
same order in which they are submitted, and there is no need to wait between
sending an assignment or password change, and sending new orders.