@@ -182,19 +182,33 @@ class ParseLiveQueryServer {
182182 clients : this . clients . size ,
183183 subscriptions : this . subscriptions . size ,
184184 useMasterKey : client . hasMasterKey ,
185- installationId : client . installationId
185+ installationId : client . installationId ,
186+ sendEvent : true ,
186187 } ;
187188 return maybeRunAfterEventTrigger ( 'afterEvent' , className , res ) ;
188189 } )
189190 . then ( ( ) => {
191+ if ( ! res . sendEvent ) {
192+ return ;
193+ }
190194 if ( res . object && typeof res . object . toJSON === 'function' ) {
191195 deletedParseObject = res . object . toJSON ( ) ;
192196 deletedParseObject . className = className ;
193197 }
194198 client . pushDelete ( requestId , deletedParseObject ) ;
195199 } )
196200 . catch ( error => {
197- logger . error ( 'Matching ACL error : ' , error ) ;
201+ Client . pushError (
202+ client . parseWebSocket ,
203+ error . code || 141 ,
204+ error . message || error ,
205+ false ,
206+ requestId
207+ ) ;
208+ logger . error (
209+ `Failed running afterLiveQueryEvent on class ${ className } for event ${ res . event } with session ${ res . sessionToken } with:\n Error: ` +
210+ JSON . stringify ( error )
211+ ) ;
198212 } ) ;
199213 }
200214 }
@@ -297,7 +311,6 @@ class ParseLiveQueryServer {
297311 isCurrentMatched ,
298312 subscription . hash
299313 ) ;
300-
301314 // Decide event type
302315 let type ;
303316 if ( isOriginalMatched && isCurrentMatched ) {
@@ -322,12 +335,16 @@ class ParseLiveQueryServer {
322335 clients : this . clients . size ,
323336 subscriptions : this . subscriptions . size ,
324337 useMasterKey : client . hasMasterKey ,
325- installationId : client . installationId
338+ installationId : client . installationId ,
339+ sendEvent : true ,
326340 } ;
327341 return maybeRunAfterEventTrigger ( 'afterEvent' , className , res ) ;
328342 } )
329343 . then (
330344 ( ) => {
345+ if ( ! res . sendEvent ) {
346+ return ;
347+ }
331348 if ( res . object && typeof res . object . toJSON === 'function' ) {
332349 currentParseObject = res . object . toJSON ( ) ;
333350 currentParseObject . className =
@@ -349,7 +366,17 @@ class ParseLiveQueryServer {
349366 }
350367 } ,
351368 error => {
352- logger . error ( 'Matching ACL error : ' , error ) ;
369+ Client . pushError (
370+ client . parseWebSocket ,
371+ error . code || 141 ,
372+ error . message || error ,
373+ false ,
374+ requestId
375+ ) ;
376+ logger . error (
377+ `Failed running afterLiveQueryEvent on class ${ className } for event ${ res . event } with session ${ res . sessionToken } with:\n Error: ` +
378+ JSON . stringify ( error )
379+ ) ;
353380 }
354381 ) ;
355382 }
@@ -658,7 +685,7 @@ class ParseLiveQueryServer {
658685 } catch ( error ) {
659686 Client . pushError (
660687 parseWebsocket ,
661- error . code || 101 ,
688+ error . code || 141 ,
662689 error . message || error ,
663690 false
664691 ) ;
@@ -776,7 +803,7 @@ class ParseLiveQueryServer {
776803 } catch ( e ) {
777804 Client . pushError (
778805 parseWebsocket ,
779- e . code || 101 ,
806+ e . code || 141 ,
780807 e . message || e ,
781808 false ,
782809 request . requestId
0 commit comments