ENGINE-681: doh, sticking it inside the loop was done. Basically, the command shouldn't run if we're already grouped, because the flags are already set on the right idents. ENGINE-681
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 02 Dec 2019 20:59:28 +0100
branchENGINE-681
changeset 423032e460bdb3a1
parent 4229 5b2f9c4d1519
child 4232 ff8b471ba647
ENGINE-681: doh, sticking it inside the loop was done. Basically, the command shouldn't run if we're already grouped, because the flags are already set on the right idents.
sync/cond_act_sync.yml2
     1.1 --- a/sync/cond_act_sync.yml2	Mon Dec 02 15:02:01 2019 +0100
     1.2 +++ b/sync/cond_act_sync.yml2	Mon Dec 02 20:59:28 2019 +0100
     1.3 @@ -429,15 +429,14 @@
     1.4  
     1.5      bool is_grouped = false;
     1.6      status = deviceGrouped(session, &is_grouped);
     1.7 -    if (status)
     1.8 +    // If this device is already grouped, the requisite flags have already been set.
     1.9 +    // Don't set again, lest we pick up new idents.
    1.10 +    if (status || is_grouped)
    1.11          return status;
    1.12  
    1.13      // set flag for all keys; don't change anything else
    1.14      for (identity_list *il = session->sync_state.own.identities; il && il->ident ; il = il->next) {
    1.15 -        // if the keys are not already marked as not for sync and the 
    1.16 -        // device isn't already grouped (because those identities should 
    1.17 -        // already have the flag set), set the device group flag.
    1.18 -        if (!(il->ident->flags & PEP_idf_not_for_sync) && !(is_grouped)) {
    1.19 +        if (!(il->ident->flags & PEP_idf_not_for_sync)) {
    1.20              status = set_identity_flags(session, il->ident, PEP_idf_devicegroup);
    1.21              if (status)
    1.22                  return status;