ensure link-call cache is updated when link-in is modified

fixes #3694
depends on node-red-node-test-helper@0.3.0
This commit is contained in:
Steve-Mcl
2022-06-20 18:25:41 +01:00
parent fc5a5f1b73
commit 9729c89f5d
3 changed files with 51 additions and 11 deletions

View File

@@ -109,16 +109,13 @@ module.exports = function(RED) {
},
remove(node) {
const target = generateTarget(node);
const tn = this.getTarget(target.name, target.flowId);
if (tn) {
const targs = this.getTargets(tn.name);
const idx = getIndex(targs, tn.id);
if (idx > -1) {
targs.splice(idx, 1);
}
if (targs.length === 0) {
delete registry.name[tn.name];
}
const targs = this.getTargets(target.name);
const idx = getIndex(targs, target.id);
if (idx > -1) {
targs.splice(idx, 1);
}
if (targs.length === 0) {
delete registry.name[tn.name];
}
delete registry.id[target.id];
},