fix: races in end of turn (#16566)

This commit is contained in:
jif-oai authored and GitHub committed 2026-04-02 15:55:55 +02:00
1 parent bd50496411
commit e47ed5e57f
5 files changed
+72 -6

No files matched your search

+6 -2
View File
@@ -215,17 +215,21 @@ impl TurnState {
}
pub(crate) fn defer_mailbox_delivery_to_next_turn(&mut self) {
self.mailbox_delivery_phase = MailboxDeliveryPhase::NextTurn;
self.set_mailbox_delivery_phase(MailboxDeliveryPhase::NextTurn);
}
pub(crate) fn accept_mailbox_delivery_for_current_turn(&mut self) {
self.mailbox_delivery_phase = MailboxDeliveryPhase::CurrentTurn;
self.set_mailbox_delivery_phase(MailboxDeliveryPhase::CurrentTurn);
}
pub(crate) fn accepts_mailbox_delivery_for_current_turn(&self) -> bool {
self.mailbox_delivery_phase == MailboxDeliveryPhase::CurrentTurn
}
pub(crate) fn set_mailbox_delivery_phase(&mut self, phase: MailboxDeliveryPhase) {
self.mailbox_delivery_phase = phase;
}
pub(crate) fn record_granted_permissions(&mut self, permissions: PermissionProfile) {
self.granted_permissions =
merge_permission_profiles(self.granted_permissions.as_ref(), Some(&permissions));