From a07757c31364fe4c49b215a4e53040499852ae34 Mon Sep 17 00:00:00 2001 From: David Kerschner Date: Fri, 25 Sep 2020 15:35:12 -0700 Subject: [PATCH] landscape: channel.js plumbing acks through for subscriptions --- pkg/arvo/app/landscape/js/channel.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/app/landscape/js/channel.js b/pkg/arvo/app/landscape/js/channel.js index 0cc70008c..c9c80b5f2 100644 --- a/pkg/arvo/app/landscape/js/channel.js +++ b/pkg/arvo/app/landscape/js/channel.js @@ -103,14 +103,16 @@ class Channel { path, connectionErrFunc = () => {}, eventFunc = () => {}, - quitFunc = () => {}) { + quitFunc = () => {}, + subAckFunc = () => {}) { let id = this.nextId(); this.outstandingSubscriptions.set( id, { err: connectionErrFunc, event: eventFunc, - quit: quitFunc + quit: quitFunc, + subAck: subAckFunc } ); @@ -210,6 +212,9 @@ class Channel { if (obj.hasOwnProperty("err")) { funcs["err"](obj.err); this.outstandingSubscriptions.delete(obj.id); + } else if (obj.hasOwnProperty("ok")) { + funcs["subAck"](obj); + this.outstandingSubscriptions.delete(obj.id); } } else if (obj.response == "diff") { let funcs = subFuncs;