Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fix: allow match auto-provisioned devices and groups when the same type is used by several groups (which always uses different apikeys) (#1713)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a test covering this cases be added?

- Add: index for Device model based on {service: 1, subservice: 1, id: 1, apikey: 1} (#1576)
- Fix: Duplicated Devices when burst measures to non provisioned Device (iotagent-json#865)
- Fix: modified JEXL transformations (toisostring, gettime, parseint, etc.) to return null instead of NaN when some unexpected situation occurs (#1701)
16 changes: 15 additions & 1 deletion lib/services/ngsi/ngsiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,21 @@ function executeWithDeviceInformation(operationFunction) {
deviceInformation
);
const currentType = type ? type : deviceInformation.type;
config.getGroupRegistry().getTypeSilently(currentType, function (error, deviceGroup) {

function getConfiguration(currentType, deviceInformation, callback) {
config
.getGroupRegistry()
.getSilently(deviceInformation.resource, deviceInformation.apikey, function (error, deviceGroup) {
if (error) {
config.getGroupRegistry().getTypeSilently(currentType, function (error, deviceGroup) {
callback(error, deviceGroup);
});
} else {
callback(null, deviceGroup);
}
});
}
getConfiguration(currentType, deviceInformation, function (error, deviceGroup) {
let typeInformation;
const configDeviceInfo = config.getConfig().types[currentType];
if (error) {
Expand Down