@@ -553,7 +553,7 @@ const sharedActions = {
553553 * @param {STEVE_WATCH_PARAMS } params
554554 */
555555 watch ( {
556- state, dispatch, getters, rootGetters
556+ state, dispatch, getters, rootGetters, commit
557557 } , params ) {
558558 state . debugSocket && console . info ( `Watch Request [${ getters . storeName } ]` , JSON . stringify ( params ) ) ; // eslint-disable-line no-console
559559 let {
@@ -620,6 +620,9 @@ const sharedActions = {
620620 if ( debounceMs ) {
621621 msg . debounceMs = debounceMs ;
622622 }
623+
624+ // Anything in the queue will pollute the result set, so clear (and print to console so we know it's working)
625+ commit ( 'clearFromQueue' , { type, log : true } ) ;
623626 }
624627 }
625628
@@ -1556,10 +1559,20 @@ const defaultMutations = {
15561559 state . socketListenerManager = new SteveWatchEventListenerManager ( state . config . namespace ) ;
15571560 } ,
15581561
1559- clearFromQueue ( state , type ) {
1562+ clearFromQueue ( state , args ) {
1563+ const safeArgs = typeof args === 'object' ? args : { type : args } ;
1564+ const { type, log } = safeArgs ;
1565+
15601566 // Remove anything in the queue that is a resource update for the given type
15611567 state . queue = state . queue . filter ( ( item ) => {
1562- return item . body ?. type !== type ;
1568+ const keep = item . body ?. type !== type ;
1569+
1570+ if ( ! keep && log ) {
1571+ // eslint-disable-next-line no-console
1572+ console . info ( `Clearing queued item of type \`${ type } \` from queue` , item ) ;
1573+ }
1574+
1575+ return keep ;
15631576 } ) ;
15641577 } ,
15651578} ;
0 commit comments