Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix adding meshes and user groups in a peering environment #6534

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
26 changes: 14 additions & 12 deletions db.js
Original file line number Diff line number Diff line change
Expand Up @@ -4089,12 +4089,13 @@ module.exports.CreateDB = function (parent, func) {
}

// Send the mesh update
if (mesh.deleted) { mesh.action = 'deletemesh'; } else { mesh.action = (added ? 'createmesh' : 'meshchange'); }
mesh.meshid = mesh._id;
mesh.nolog = 1;
delete mesh.type;
delete mesh._id;
parent.DispatchEvent(['*', mesh.meshid], obj, parent.webserver.CloneSafeMesh(mesh));
var mesh2 = Object.assign({}, mesh); // Shallow clone
if (mesh2.deleted) { mesh2.action = 'deletemesh'; } else { mesh2.action = (added ? 'createmesh' : 'meshchange'); }
mesh2.meshid = mesh2._id;
mesh2.nolog = 1;
delete mesh2.type;
delete mesh2._id;
parent.DispatchEvent(['*', mesh2.meshid], obj, parent.webserver.CloneSafeMesh(mesh2));
}

// Called when a user account has changed
Expand Down Expand Up @@ -4138,12 +4139,13 @@ module.exports.CreateDB = function (parent, func) {
}

// Send the user group update
usergroup.action = (added ? 'createusergroup' : 'usergroupchange');
usergroup.ugrpid = usergroup._id;
usergroup.nolog = 1;
delete usergroup.type;
delete usergroup._id;
parent.DispatchEvent(['*', usergroup.ugrpid], obj, usergroup);
var usergroup2 = Object.assign({}, usergroup); // Shallow clone
usergroup2.action = (added ? 'createusergroup' : 'usergroupchange');
usergroup2.ugrpid = usergroup2._id;
usergroup2.nolog = 1;
delete usergroup2.type;
delete usergroup2._id;
parent.DispatchEvent(['*', usergroup2.ugrpid], obj, usergroup2);
}

function dbMergeSqlArray(arr) {
Expand Down
Loading