Closed webworker01 closed 6 years ago
You have to use subscribe for updateExchangeState and listen for updateSummaryState separately.
Yes thank you, that's what I've done.
I receive results for both in both callbacks instead of the expected behavior of listen returning just updateSummaryState results and subscribe returning just updateExchangeState results.
If you have check the source code you would know why.
data.M.forEach(function(M) {
if (websocketGlobalTickerCallback) {
websocketGlobalTickerCallback(M, wsclient);
}
if (websocketMarketsCallback) {
websocketMarketsCallback(M, wsclient);
}
});
Yes, I knew this would happen when I did it. I only kept it that way because all of the examples from the original versions showed that you needed to filter for the data type. I considered changing it but thought a smaller change would be better than I'll wait to see how people felt about it. I, for one, want to change it. Cast your vote, let me know if it'd screw up anything you've done.
Sorry if I am not describing what is happening as clearly as I hoped.
In this image you can see that I'm making both connections, I am now using subscribe(), and then separately listen(). In the callbacks for each I still have the filters in place checking data.M for the types of data being returned.
I believe that now it is returning duplicate results to both callbacks as if I used subscribe twice and listen twice. My database has grown to twice the size in a few days (I prune results every 24 hours) and I'm seeing duplicate records.
Hm, ok that's not what I thought you were describing. That is odd.
It's odd, seems to not be doing this anymore. Gonna close the issue.
It seems consistent with the issues I've been experiencing on the website. I've been getting repeat entries in the order history showing up on their website so it was likely a fixed bug.
Thank you, I thought I was going mad :)
It seems we must now use listen as well as subscribe if we want to get updateSummaryState and updateExchangeState results.
However doing this now returns updateSummaryState and updateExchangeState in both callbacks resulting in duplicate data.