@@ -54,15 +54,18 @@ def __init__(self, connection: "Connection", object: "ChannelOwner") -> None:
54
54
self ._guid = object ._guid
55
55
self ._object = object
56
56
self .on ("error" , lambda exc : self ._connection ._on_event_listener_error (exc ))
57
+ self ._is_internal_type = False
57
58
58
59
async def send (self , method : str , params : Dict = None ) -> Any :
59
60
return await self ._connection .wrap_api_call (
60
- lambda : self .inner_send (method , params , False )
61
+ lambda : self ._inner_send (method , params , False ),
62
+ self ._is_internal_type ,
61
63
)
62
64
63
65
async def send_return_as_dict (self , method : str , params : Dict = None ) -> Any :
64
66
return await self ._connection .wrap_api_call (
65
- lambda : self .inner_send (method , params , True )
67
+ lambda : self ._inner_send (method , params , True ),
68
+ self ._is_internal_type ,
66
69
)
67
70
68
71
def send_no_reply (self , method : str , params : Dict = None ) -> None :
@@ -73,7 +76,7 @@ def send_no_reply(self, method: str, params: Dict = None) -> None:
73
76
)
74
77
)
75
78
76
- async def inner_send (
79
+ async def _inner_send (
77
80
self , method : str , params : Optional [Dict ], return_as_dict : bool
78
81
) -> Any :
79
82
if params is None :
@@ -108,6 +111,9 @@ async def inner_send(
108
111
key = next (iter (result ))
109
112
return result [key ]
110
113
114
+ def mark_as_internal_type (self ) -> None :
115
+ self ._is_internal_type = True
116
+
111
117
112
118
class ChannelOwner (AsyncIOEventEmitter ):
113
119
def __init__ (
@@ -132,7 +138,6 @@ def __init__(
132
138
self ._channel : Channel = Channel (self ._connection , self )
133
139
self ._initializer = initializer
134
140
self ._was_collected = False
135
- self ._is_internal_type = False
136
141
137
142
self ._connection ._objects [guid ] = self
138
143
if self ._parent :
@@ -157,9 +162,6 @@ def _adopt(self, child: "ChannelOwner") -> None:
157
162
self ._objects [child ._guid ] = child
158
163
child ._parent = self
159
164
160
- def mark_as_internal_type (self ) -> None :
161
- self ._is_internal_type = True
162
-
163
165
def _set_event_to_subscription_mapping (self , mapping : Dict [str , str ]) -> None :
164
166
self ._event_to_subscription_mapping = mapping
165
167
@@ -359,7 +361,12 @@ def _send_message_to_server(
359
361
"params" : self ._replace_channels_with_guids (params ),
360
362
"metadata" : metadata ,
361
363
}
362
- if self ._tracing_count > 0 and frames and not object ._is_internal_type :
364
+ if (
365
+ self ._tracing_count > 0
366
+ and frames
367
+ and frames
368
+ and object ._guid != "localUtils"
369
+ ):
363
370
self .local_utils .add_stack_to_tracing_no_reply (id , frames )
364
371
365
372
self ._transport .send (message )
0 commit comments