C
C#2y ago
SWEETPONY

✅ Why breakpoint is not hitting?

I have following:
await _mqttClient.Subscribe( subscription, OnReceived );

private async Task OnReceived(
IMqttClient sender,
MqttDelivery mqttDelivery )
{
var subTopic = mqttDelivery.Topic.Split( '/' );

var addResult = TreeRoot.Add( subTopic );

if(!addResult)
{
// do smth
}
}

public bool Add( string[] subTopic )
=> Add( subTopic, Level + 1);
await _mqttClient.Subscribe( subscription, OnReceived );

private async Task OnReceived(
IMqttClient sender,
MqttDelivery mqttDelivery )
{
var subTopic = mqttDelivery.Topic.Split( '/' );

var addResult = TreeRoot.Add( subTopic );

if(!addResult)
{
// do smth
}
}

public bool Add( string[] subTopic )
=> Add( subTopic, Level + 1);

I don't understand why breakpoint has never be hitted inside addResult check even if addResult will be false.. it looks very strange
2 Replies
Stan
Stan2y ago
check if OnReceived gets triggered at all by putting the breakpoint at the first line of the method.
SWEETPONY
SWEETPONYOP2y ago
its strange!
Want results from more Discord servers?
Add your server