From 1654e458d5b26f34a00a31d5e1b6097749cf1d72 Mon Sep 17 00:00:00 2001 From: "vivek.kumar3" Date: Wed, 15 May 2024 17:48:53 +0530 Subject: [PATCH 1/2] #1524 fix --- lib/services/groups/groupRegistryMongoDB.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/services/groups/groupRegistryMongoDB.js b/lib/services/groups/groupRegistryMongoDB.js index 740a3fad7..44ff3107b 100644 --- a/lib/services/groups/groupRegistryMongoDB.js +++ b/lib/services/groups/groupRegistryMongoDB.js @@ -216,7 +216,9 @@ function find(service, subservice, callback) { } function findOneInMongoDB(queryObj, fields, callback) { - const query = Group.model.findOne(queryObj); + const query = Group.model.findOne({ + $or: [{ apikey: queryObj.apikey }, { type: queryObj.type }] + }); query.select({ __v: 0 }); query.lean().exec(function handleGet(error, data) { if (error) { @@ -224,6 +226,7 @@ function findOneInMongoDB(queryObj, fields, callback) { callback(new errors.InternalDbError(error)); } else if (data) { context = fillService(context, data); + queryObj.resource = data.resource; logger.debug(context, 'Device group data found: %j', data); callback(null, data); } else { From 889e0e085587efeb4b866d286ddfa185a73f8648 Mon Sep 17 00:00:00 2001 From: vivekNEC <100183705+vivekNEC@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:31:00 +0530 Subject: [PATCH 2/2] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 25e0be54d..19a9c8f71 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ - Fix: default express limit to 1Mb instead default 100Kb and allow change it throught a conf env var 'IOTA_EXPRESS_LIMIT' (telefonicaid/iotagent-json#827) +- Fix: autoprovison now working with resources diferent from defaultResource (#1524)