Closed NiklasHeneka closed 8 months ago
8a93db7 should have fixed the issue the backend now contains a ConnectionObject, which emits events whenever the connection state changes!
Here it should be noted that the Connection Status if different than the State of the System (not a state of the FSM).
ConnectionObject emits the event "connection-status", which as a payload contains the ConnectionStatus enum defined in connection.rs and is serialized as a string
You don't send any events yet right?
i will check, but i think so gimmi a min
8a93db71 Following the rest of the architecture and to be consistant the connection_status event has to be listent to if you want i can change that and have it be listened to by default maybe a good idea. What do you think.
Wait and there is no listen command yet ? What seems more reasonable to you? I would be fine with both maybe a listen command is overkill i dont now?
@NiklasHeneka
Interesstingly the current implementation should have a bug, where a tauri event is always broadcasted at the start.
tauri event should be:
connection-status
with a string as payload
i asked @arrowtip and the conclusion is default is probably simpler so that what iam going for
the current implementation in 7552a64a0109ba6124b941a20a1ae013d8c1c601 will broadcast the state as a tauri event called connection-status
see connection.rs in cnl. However this event might be broadcasted before the react application starts and therefor is dropped by react. That's why a command called get_connection_status() -> ConnectionStatus
is provided to fetch the current connection status. ConnectionStatus
is serialized as a string see connection.rs on what values are allowed!
If the connection_status changes through the livetime of the application the tauri event will be broadcasted containing the ConnectionStatus as payload serialized as a string.
@NiklasHeneka
You can take a look inb5797d5 at the EstablishConnection file in the frontend. It seems that everything works now. Regarding listening I think it is best to listen from start as a default.
i think this looks good right ? You can close if you want to =^)
When the we should be able to press the connect button to connect to the pos "connecting_to_pod_possible" needs to be called by the backend first. It would be nice if it would be called on startup rightnow I just dont get it to work.