Topic is not returned anymore on candle (kline) updates
Closed this issue · 3 comments
for Kline updates, the event's Topic property used to return the symbol for the candle. It seems that the message isn't being parsed correctly using the _symbol path property or perhaps v2 of the API uses 'key' instead of 'symbol'. You can return the symbol by using the key property on the message:
`public override string? GetListenerIdentifier(IMessageAccessor message)
{
var symbol = message.GetValue<string>(_symbolPath); //returns null
message
{CryptoExchange.Net.Converters.JsonNet.JsonNetByteMessageAccessor}
IsJson: true
OriginalDataAvailable: true
Underlying: {{
"event": "subscribed",
"channel": "candles",
"chanId": 116092,
"key": "trade:1m:t1INCH:USD"
}}
_token: {{
"event": "subscribed",
"channel": "candles",
"chanId": 116092,
"key": "trade:1m:t1INCH:USD"
}}
`
I found the bug, in the SubscribeToKlineUpdatesAsync function, null is sent to the symbol parameter. Can you please update the library to replace null with symbol. I tried downloading the source and amending the function but for some reason I get a timeout error when attempting to subscribe. I don't get timeout errors when referencing the library via Nuget:
public async Task<CallResult<UpdateSubscription>> SubscribeToKlineUpdatesAsync(string symbol, KlineInterval interval, Action<DataEvent<IEnumerable<BitfinexKline>>> handler, CancellationToken ct = default) { //bug in Bitfinex.Net library, null was sent as symbol var subscription = new BitfinexSubscription<BitfinexKline>(_logger, "candles", **null**, handler, key: $"trade:{JsonConvert.SerializeObject(interval, new KlineIntervalConverter(false))}:" + symbol);
Has been fixed in the latest version