Currently the desktop will emit a 'loaded' signal over dbus when its loaded, and other pieces may use dbus-wait to wait for the desktop to be loaded before doing more. Currently the keyboard does this. It would also make sense for the runtime image testing to watch for the signal to say that the desktop is close enough to being usable. However, as this is a one-time signal there's a huge race condition: what if the signal is fired before it is watched for? The solution to this would be for the desktop to take ownership of org.matchbox.Desktop or similar on the bus. This can be checked at any time, and signals sent when it is acquired, so can be race-free. For example: https://docs.gtk.org/gio/migrating-gdbus.html#owning-bus-names
It would be sensible to change dbus-wait to support both waiting for a signal or checking if a name exists.