trezor-firmware icon indicating copy to clipboard operation
trezor-firmware copied to clipboard

UI2: Global layout object

Open matejcik opened this issue 3 years ago • 1 comments

We have already faced several issues, mostly in automated tests, where a race condition arose between two layouts competing for screen time.

The current UI code handles the competition via a "cancellation channel", but that is not 100% stable

With Rust UI, we need a clean way to register and deregister timer events. The way the current code works, all timer events go through the same loop.Timer instance, which means that the same instance can be resumed multiple times, producing highly non-deterministic results unless being handled very carefully.

As an alternative, instead of spawning a handle_timers loop that awaits the timer object, we could schedule timer objects directly on the

(summary tbd)

matejcik avatar May 26 '22 12:05 matejcik

See also: https://github.com/trezor/trezor-firmware/pull/2227#discussion_r869337119

mmilata avatar May 26 '22 12:05 mmilata