Skip to content

Commit a6dd62a

Browse files
committed
fix(fixme): clean up old fixme comment
1 parent 37a3a5b commit a6dd62a

3 files changed

Lines changed: 34 additions & 5 deletions

File tree

official-ws/nodejs/lib/deltaParser.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ module.exports = {
6363
debug('partial: %s %s, data: %j', tableName, symbol, data);
6464
const dataArr = data.data || [];
6565
// Intitialize data.
66-
// FIXME: we need to echo back `filter` with each partial, otherwise we can't tell the difference
67-
// between no data for a symbol and a partial for a different symbol.
68-
if (!client._data[tableName][symbol] || dataArr.length) {
69-
client._data[tableName][symbol] = dataArr;
70-
}
66+
client._data[tableName][symbol] = dataArr;
7167
// Initialize keys.
7268
client._keys[tableName] = data.keys;
7369
// Return inserted data

official-ws/nodejs/test/client.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,23 @@ test('Recovering after empty partial (* subscription)', async () => {
111111

112112
expect(onOrder.callCount).toEqual(3);
113113
});
114+
115+
test('Empty partial handling', async () => {
116+
const onOrderBook = sinon.spy();
117+
118+
client.addStream('ETHYLDH23', 'orderBookL2_25', onOrderBook);
119+
playback(client, data.orderbookSymboledEmptyPartial);
120+
121+
expect(client._data['orderBookL2_25']['ETHYLDH23']).toHaveLength(0)
122+
});
123+
124+
test('Partial handling multiple stream', async () => {
125+
const onOrderBook = sinon.spy();
126+
127+
client.addStream('XBTUSD', 'orderBookL2_25', onOrderBook);
128+
client.addStream('ETHYLDH23', 'orderBookL2_25', onOrderBook);
129+
playback(client, data.orderbookSymboledEmptyPartial);
130+
131+
expect(client._data['orderBookL2_25']['XBTUSD']).toHaveLength(2)
132+
expect(client._data['orderBookL2_25']['ETHYLDH23']).toHaveLength(0)
133+
});

official-ws/nodejs/test/fixtures/data.js

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)