Implement basic recovery from non-terminal errors - #230
Conversation
…remony (plus renaming of the cancellation variant)
|
This is great! I haven't looked at the code yet, but a few notes: Instead of adding a separate Restarted event, can we use the existing *Idle events?
If we send the device error before the transport restart event, I think the UI can reset the state in the background but leave the error page up with a back button. Or they could get fancy and transition to the start page and show a toast or something.
I wonder if handling this edge case (where we know a particular authenticator cannot satisfy the request) would introduce more complexity than it value. If this part of the protocol is too tricky to implement, then no one will, but we still have to support it for backward compatibility. I think it might be fine if the user is shown an error and kicked back to the start page, and shown the same authenticators again. But I'll take a look at whatever you come up with! |
From what I can tell, the Idle events are currently not sent via dbus, so we would need to add all the handlers and everything anyways (i.e. doesn't save much lines of code).
As said above, my plan was to add a playload to the restart signal that would be displayed on the start page (probably not a toast, but a permanent text field that is invisible initially).
Yeah, I agree. Just wanted to mention what this PR does not implement. wdyt? |
|
I think that's all reasonable! The more stateful we make credentialsd means less state required on those implementing the UI. I'm just thinking about how much work this is going to be reimplementing the UI side in C for xdg-desktop-portal-gnome to get this into production, do wanted to be careful. Carry on! |
This is a rather basic recovery strategy for the UI to restart the ceremony, if something went wrong. E.g. Hybrid aborts, then a new ceremony (with a new QR-code) is started, and the UI drops back to the start page.
Shortcomings:
Still, I think this is quite usable, if one aborts the hybrid ceremony, or unplugs the USB device mid-ceremony.
Notes:
I used 3 distinct restart-events for each transport for consistency, because we do the same for other signals.
Test are also rudimentary, to keep this PR from getting very large. I'll try to add more tests with the next (hopefully smaller) PR.