When importing a .csv file with a large number of IoT devices, timeouts are very likely to occur. The main suspect is the chirpstack API which cannot keep up as numerous calls are made to the API just for a single LoRaWAN device.
This PR refactors this flow:
Devices are now sent in bulks of 50 instead of all at once, in separate requests.
Devices with similar metadata are grouped together to minimize requests made to chirpstack.
If the API's database already has the data, then requests will be made to it instead
To preserve the individual device error messages, the backend will keep track of any errors during the process and map them to the respective devices. That way, we can still process the rest of the devices from the client
Ideally, the backend would process the CSV file. However, that would mean the user doesn't get "live" updates
When importing a .csv file with a large number of IoT devices, timeouts are very likely to occur. The main suspect is the chirpstack API which cannot keep up as numerous calls are made to the API just for a single LoRaWAN device.
This PR refactors this flow:
Ideally, the backend would process the CSV file. However, that would mean the user doesn't get "live" updates
Related frontend PR
Fixes #130