From 13ae5eb44000b5f7853583de0ef7172bdafcf740 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 10:54:39 +0200 Subject: [PATCH 1/5] do not try cast when expandVar entity id and entity type --- lib/models/updateAction.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index a40e23d0..eef03cd3 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -169,8 +169,9 @@ function processOptionParams(action, event) { changes[key].metadata = theMeta; } }); - changes.id = myutils.expandVar(action.parameters.id, event, true); - changes.type = myutils.expandVar(action.parameters.type, event, true); + // Do not expandVar with trycast, since id and type should be always string values types + changes.id = myutils.expandVar(action.parameters.id, event, false); + changes.type = myutils.expandVar(action.parameters.type, event, false); logger.debug('processOptionParams changes: %j', changes); return changes; } From 375855733b7ad6f7d54d9ab533e0587c4634b3a2 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 10:58:27 +0200 Subject: [PATCH 2/5] update CNR --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index a1191de3..48ce291f 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ +- FIX: do not try cast entity id and entity type in update rules when expandVar (#791) - Fix: do not invoke calback twice when error about trust not found in trustConf (#790) From bcfc10f9b3f46c022f5a45a2ef51090dc8fc3012 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 11:06:57 +0200 Subject: [PATCH 3/5] update doc --- lib/models/updateAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index eef03cd3..1c916c25 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -169,7 +169,7 @@ function processOptionParams(action, event) { changes[key].metadata = theMeta; } }); - // Do not expandVar with trycast, since id and type should be always string values types + // Do not expandVar with trycast, since entity id and type should be always string values types changes.id = myutils.expandVar(action.parameters.id, event, false); changes.type = myutils.expandVar(action.parameters.type, event, false); logger.debug('processOptionParams changes: %j', changes); From 10df1bfa40ee251cebaf85b99f3387716cc12922 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 11:27:05 +0200 Subject: [PATCH 4/5] Update CNR --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 48ce291f..0f0b04c3 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,2 @@ -- FIX: do not try cast entity id and entity type in update rules when expandVar (#791) +- FIX: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) - Fix: do not invoke calback twice when error about trust not found in trustConf (#790) From 9973150e98186f2c39bb016cecfdd0eeb8c0f0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 22 Jul 2024 10:24:20 +0200 Subject: [PATCH 5/5] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 0f0b04c3..2fe7453c 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,2 @@ -- FIX: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) +- Fix: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) - Fix: do not invoke calback twice when error about trust not found in trustConf (#790)