chromeos_smart_card_connector
chromeos_smart_card_connector copied to clipboard
Introduce a better protocol for single-message-based communication between Connector app and the client apps
The existing protocol has several issues, mainly:
- Client restart handling is bad. Connector app may start processing the commands from the restarted app in the same environment as it was before the restart, but then, after some time, it will realize that the client app has been restarted - and it will clean up and destroy all handles and start with a clean environment after this point - which really puts the client into a weird state. The commit 215d5bab3dfd2c850beb990c62d376c0e221c5cc has a temporary workaround for this, allowing the client to wait until the full "handshake" finishes before sending the commands.
- The timeouts for sending ping messages and for considering the Connector app as dead have to be hardcoded based on the sources of the Connector app.
- There's no way in the protocol to send a generic error from the Connector app to the client (like "permission denied" or "received message has invalid format").
- Asymmetry between "ping" requests and "pong" responses is a complication that brings not many benefits.
One more item:
- The current protocol requires the 'data' field to be specified in all messages even there's no additional data to be passed.