@@ -152,7 +152,7 @@ public void TriggerDiff(SocketResponse response)
152
152
/// </summary>
153
153
/// <param name="payload"></param>
154
154
/// <param name="timeoutMs"></param>
155
- public Task Track ( object ? payload , int timeoutMs = DefaultTimeout )
155
+ public Task < Push > Track ( object ? payload , int timeoutMs = DefaultTimeout )
156
156
{
157
157
var eventName = Core . Helpers . GetMappedToAttr ( ChannelEventName . Presence ) . Mapping ;
158
158
var push = new Push ( _channel . Socket , _channel , eventName , "track" ,
@@ -169,7 +169,9 @@ void Handler(IRealtimePush<RealtimeChannel, SocketResponse> chanel, SocketRespon
169
169
170
170
push . OnTimeout += ( sender , args ) =>
171
171
{
172
- tcs . SetException ( new RealtimeException ( args . ToString ( ) ) { Reason = FailureHint . Reason . PushTimeout } ) ;
172
+ if ( sender is Push p )
173
+ tcs . SetException ( new RealtimeException ( $ "Failed to send push [{ p . Ref } ])")
174
+ { Reason = FailureHint . Reason . PushTimeout } ) ;
173
175
} ;
174
176
175
177
_channel . Enqueue ( push ) ;
@@ -180,7 +182,7 @@ void Handler(IRealtimePush<RealtimeChannel, SocketResponse> chanel, SocketRespon
180
182
/// <summary>
181
183
/// Untracks an event.
182
184
/// </summary>
183
- public Task Untrack ( )
185
+ public Task < Push > Untrack ( )
184
186
{
185
187
var eventName = Core . Helpers . GetMappedToAttr ( ChannelEventName . Presence ) . Mapping ;
186
188
var push = new Push ( _channel . Socket , _channel , eventName , "untrack" ,
@@ -197,8 +199,9 @@ void Handler(IRealtimePush<RealtimeChannel, SocketResponse> chanel, SocketRespon
197
199
198
200
push . OnTimeout += ( sender , args ) =>
199
201
{
200
- tcs . TrySetException ( new RealtimeException ( ( sender as Push ) ! . Ref )
201
- { Reason = FailureHint . Reason . PushTimeout } ) ;
202
+ if ( sender is Push p )
203
+ tcs . TrySetException ( new RealtimeException ( $ "Failed to send push [{ p . Ref } ])")
204
+ { Reason = FailureHint . Reason . PushTimeout } ) ;
202
205
} ;
203
206
204
207
_channel . Enqueue ( push ) ;
0 commit comments