[remote-dbg-next] Move connection state of runtime to ui state
Categories
(DevTools :: about:debugging, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: daisuke, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: remote-debugging-technical-debt)
This is a followup of bug 1505131.
In that bug, the runtime status has introduced the connection status that a flag which is connecting or not, error of connection, and a flag which is taking time for connection. However, we might better introduce those status as ui
state not runtime
state. In this bug, we discuss about this, and fix if needed.
Comment 1•6 years ago
|
||
Note: we need more discussion about how to exactly solve this.
Comment 2•6 years ago
|
||
While reviewing a patch that adds yet another of those flags, I think a good compromise would be to introduce a "connectionStatus" object on runtime objects, that would keep all the flags.
runtimes.forEach(runtime => {
const existingRuntime = findRuntimeById(runtime.id, getState().runtimes);
const isConnectionValid = existingRuntime && existingRuntime.runtimeDetails &&
!existingRuntime.runtimeDetails.clientWrapper.isClosed();
runtime.runtimeDetails = isConnectionValid ? existingRuntime.runtimeDetails : null;
runtime.isConnecting = existingRuntime ? existingRuntime.isConnecting : false;
runtime.isConnectionFailed =
existingRuntime ? existingRuntime.isConnectionFailed : false;
runtime.isConnectionNotResponding =
existingRuntime ? existingRuntime.isConnectionNotResponding : false;
runtime.isConnectionTimeout =
existingRuntime ? existingRuntime.isConnectionTimeout : false;
});
would become
runtimes.forEach(runtime => {
const existingRuntime = findRuntimeById(runtime.id, getState().runtimes);
const isConnectionValid = existingRuntime && existingRuntime.runtimeDetails &&
!existingRuntime.runtimeDetails.clientWrapper.isClosed();
runtime.runtimeDetails = isConnectionValid ? existingRuntime.runtimeDetails : null;
runtime.connectionStatus = existingRuntime ? existingRuntime.connectionStatus : {};
});
Or maybe instead of 4 boolean flags, we can have one field "connectionState" that can be either: ["CONNECTING", "NOT_RESPONDING", "TIMED_OUT", "FAILED"]. We could also add the two states "DISCONNECTED", "CONNECTED", but we infer those from runtime.runtimeDetails
so they might be confusing without more refactor.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•2 years ago
|
Description
•