diff --git a/lib/ws_servers/api/algos/algo_worker.js b/lib/ws_servers/api/algos/algo_worker.js index 1dfbea60..18541db5 100644 --- a/lib/ws_servers/api/algos/algo_worker.js +++ b/lib/ws_servers/api/algos/algo_worker.js @@ -349,12 +349,14 @@ class AlgoWorker { const [serialized, uiData] = await ao const { id, name, label, args, gid, i18n, createdAt } = uiData - d('ao started: %s %s', name, label) + const alias = uiData.alias || name + + d('ao started: %s %s', alias, label) await this._updateAlgo(serialized) - this.sendSuccess(`Started AO ${name} on Bitfinex`, ['startedAO', { name, target: 'Bitfinex' }]) - this.pub(['data.ao', 'bitfinex', mode, { id, gid, name, label, args, i18n, createdAt }]) + this.sendSuccess(`Started AO ${alias} on Bitfinex`, ['startedAO', { alias, name, target: 'Bitfinex' }]) + this.pub(['data.ao', 'bitfinex', mode, { id, gid, alias, name, label, args, i18n, createdAt }]) return gid } catch (e) { d('error starting AO %s: %s for %s: %s', aoID, e, this.userId, e.stack) diff --git a/package.json b/package.json index 37c6eb9f..fbd34ee9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bfx-hf-server", - "version": "8.1.0", + "version": "8.2.0", "description": "HF server bundle", "author": "Bitfinex", "license": "Apache-2.0", @@ -22,7 +22,7 @@ "bfx-api-node-core": "git+https://github.com/bitfinexcom/bfx-api-node-core.git#v1.6.1", "bfx-api-node-plugin-wd": "^1.0.4", "bfx-api-node-rest": "^4.3.1", - "bfx-hf-algo": "git+https://github.com/bitfinexcom/bfx-hf-algo.git#v4.14.2", + "bfx-hf-algo": "git+https://github.com/bitfinexcom/bfx-hf-algo.git#v4.15.0", "bfx-hf-ext-plugin-dummy": "github:bitfinexcom/bfx-hf-ext-plugin-dummy#v1.0.4", "bfx-hf-indicators": "git+https://github.com/bitfinexcom/bfx-hf-indicators.git#v2.1.1", "bfx-hf-models": "git+https://github.com/bitfinexcom/bfx-hf-models.git#v4.0.0", diff --git a/test/unit/lib/ws_servers/api/algos/algo_worker.js b/test/unit/lib/ws_servers/api/algos/algo_worker.js index 31893bf7..e853f024 100644 --- a/test/unit/lib/ws_servers/api/algos/algo_worker.js +++ b/test/unit/lib/ws_servers/api/algos/algo_worker.js @@ -211,6 +211,7 @@ describe('AlgoWorker', () => { const createdAt = 1633936704466 const serialized = { gid } const uiData = { + alias: 'alias', name: 'name', label: 'label', args: {}, @@ -248,8 +249,8 @@ describe('AlgoWorker', () => { assert.calledWithExactly(WsStub.firstCall, [ 'notify', 'success', - 'Started AO name on Bitfinex', - { key: 'startedAO', props: { name: 'name', target: 'Bitfinex' } } + `Started AO ${uiData.alias} on Bitfinex`, + { key: 'startedAO', props: { alias: uiData.alias, name: 'name', target: 'Bitfinex' } } ]) assert.calledWithExactly(WsStub.secondCall, ['data.ao', 'bitfinex', mode, { ...uiData }]) expect(returnedGid).to.eq(gid) @@ -276,8 +277,8 @@ describe('AlgoWorker', () => { assert.calledWithExactly(WsStub.firstCall, [ 'notify', 'success', - 'Started AO name on Bitfinex', - { key: 'startedAO', props: { name: 'name', target: 'Bitfinex' } } + `Started AO ${uiData.alias} on Bitfinex`, + { key: 'startedAO', props: { alias: uiData.alias, name: 'name', target: 'Bitfinex' } } ]) assert.calledWithExactly(WsStub.secondCall, ['data.ao', 'bitfinex', mode, { ...uiData }]) expect(returnedGid).to.eq(gid)