brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.48k stars 545 forks source link

Chirpstack produces undesirable ACK event for disabled class C device #612

Closed vsaljooghi closed 1 month ago

vsaljooghi commented 2 months ago

What happened?

I have a LoRa device that operates in class C. I set up 15 min timeout for it using its device profile ClassCTimeout attribute. Before timeout expires, I disable the device. Unfortunately, I still receive NACK (ack = false) for disabled device.

What did you expect?

The same way that I don't receive any uplink event for a disabled device. I should not get any ack event. Probably there is a timer being set to count until timeout reaches (This timer mechanism also should be disabled as soon as the device is disabled in chirpstack. Is there any API to disable that timer?)

Steps to reproduce this issue

Steps:

  1. I am using gRPC API to disable the device and when I receive unwanted NACK event for a disabled device, it causes my integration app to crash (because I don't expect any further events coming from a disabled device, I have not put the effort to check for extra nil reference accesses in my code structure).

Could you share your log output?

Your Environment

Component Version
Application Server v3.17.6
Network Server v3.16.2
Gateway Bridge
Chirpstack API
Geolocation
Concentratord
brocaar commented 1 month ago

You have created an issue for ChirpStack v3, the latest version is v4 and I recommend you upgrade to v4. I have checked and this issue is present in v4, I will push a fix shortly (for v4).