@@ -20,6 +20,8 @@ export function initSocketService(httpServer: any, sessions: Map<string, SailFDC
20
20
var type : SocketType | undefined = undefined
21
21
22
22
socket . on ( DA_HELLO , function ( props : DesktopAgentHelloArgs ) {
23
+ console . log ( JSON . stringify ( props ) )
24
+
23
25
type = SocketType . DESKTOP_AGENT
24
26
userSessionId = props . userSessionId
25
27
console . log ( "Desktop Agent Connecting" , userSessionId )
@@ -45,11 +47,14 @@ export function initSocketService(httpServer: any, sessions: Map<string, SailFDC
45
47
if ( session ) {
46
48
callback ( session ?. getDirectory ( ) . allApps )
47
49
} else {
50
+ console . error ( "Session not found" , userSessionId )
48
51
callback ( null , "Session not found" )
49
52
}
50
53
} )
51
54
52
55
socket . on ( DA_REGISTER_APP_LAUNCH , async function ( props : DesktopAgentRegisterAppLaunchArgs , callback : ( success : any , err ?: string ) => void ) {
56
+ console . log ( JSON . stringify ( props ) )
57
+
53
58
const { appId, userSessionId } = props
54
59
const session = sessions . get ( userSessionId )
55
60
if ( session ) {
@@ -62,11 +67,14 @@ export function initSocketService(httpServer: any, sessions: Map<string, SailFDC
62
67
console . log ( "Registered app" , appId , instanceId )
63
68
callback ( instanceId )
64
69
} else {
70
+ console . error ( "Session not found" , userSessionId )
65
71
callback ( null , "Session not found" )
66
72
}
67
73
} )
68
74
69
75
socket . on ( APP_HELLO , function ( props : AppHelloArgs ) {
76
+ console . log ( JSON . stringify ( props ) )
77
+
70
78
appInstanceId = props . instanceId
71
79
userSessionId = props . userSessionId
72
80
type = SocketType . APP
@@ -96,7 +104,7 @@ export function initSocketService(httpServer: any, sessions: Map<string, SailFDC
96
104
console . error ( "App tried to connect with invalid instance id" )
97
105
}
98
106
} else {
99
- console . log ( "App Tried Connecting to non-existent DA Instance " , userSessionId , appInstanceId )
107
+ console . error ( "App Tried Connecting to non-existent DA Instance " , userSessionId , appInstanceId )
100
108
}
101
109
} )
102
110
@@ -110,6 +118,8 @@ export function initSocketService(httpServer: any, sessions: Map<string, SailFDC
110
118
} catch ( e ) {
111
119
console . error ( "Error processing message" , e )
112
120
}
121
+ } else {
122
+ console . error ( "No Server instance" )
113
123
}
114
124
} )
115
125
@@ -123,6 +133,8 @@ export function initSocketService(httpServer: any, sessions: Map<string, SailFDC
123
133
sessions . delete ( userSessionId ! ! )
124
134
console . error ( "Desktop Agent Disconnected" , userSessionId )
125
135
}
136
+ } else {
137
+ console . error ( "No Server instance" )
126
138
}
127
139
} )
128
140
} )
0 commit comments