Skip to content

Commit

Permalink
Merge pull request #792 from telefonicaid/fix/do_not_expand_to_non_st…
Browse files Browse the repository at this point in the history
…ring_id_type_entity

do not try cast when expandVar entity id and entity type
  • Loading branch information
fgalan authored Jul 22, 2024
2 parents 0016fe4 + 9973150 commit 945f0a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +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 invoke calback twice when error about trust not found in trustConf (#790)
5 changes: 3 additions & 2 deletions lib/models/updateAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 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);
return changes;
}
Expand Down

0 comments on commit 945f0a8

Please sign in to comment.