1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

fixup! core/webauthn: Allow new workflow to be set after a command response is sent, so that in device tests the next test doesn't fail with ERR_CHANNEL_BUSY while the previous workflow is closing.

This commit is contained in:
Andrew Kozlik 2019-11-20 19:58:39 +01:00 committed by matejcik
parent c463069895
commit 790178a442

View File

@ -908,7 +908,15 @@ class DialogManager:
def is_busy(self) -> bool:
if utime.ticks_ms() >= self.deadline:
self.reset()
return bool(workflow.tasks or self.workflow)
if self.workflow is None:
return bool(workflow.tasks)
if self.state is None or self.state.finished:
self.reset()
return False
return True
def compare(self, state: State) -> bool:
if self.state != state:
@ -919,12 +927,7 @@ class DialogManager:
return True
def set_state(self, state: State) -> bool:
if self.workflow is not None:
if self.state is None or self.state.finished:
self.reset()
else:
return False
elif workflow.tasks:
if self.is_busy():
return False
self.state = state