From 81f4251e77fdbd5bd83dfc27fef396501572bbda Mon Sep 17 00:00:00 2001 From: Krista Bennett Date: Thu, 22 Jul 2021 14:01:02 +0200 Subject: [PATCH] ENGINE-890: I presume this fix can just be transferred over. Can't get resolution on the issue, so this is the best I can do to move it forward. --- src/sync_api.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/sync_api.c b/src/sync_api.c index f03b2c25..1cf268c7 100644 --- a/src/sync_api.c +++ b/src/sync_api.c @@ -4,6 +4,7 @@ // This file is under GNU General Public License 3.0 // see LICENSE.txt + #include "pEp_internal.h" #include @@ -293,10 +294,6 @@ DYNAMIC_API PEP_STATUS enable_identity_for_sync(PEP_SESSION session, ident->flags = stored_ident->flags; free_identity(stored_ident); - // this is an invalid state; detect while debugging - - assert(!((ident->flags & PEP_idf_devicegroup) && (ident->flags & PEP_idf_not_for_sync))); - // if we're grouped and this identity is enabled already we can stop here if ((ident->flags & PEP_idf_devicegroup) && !(ident->flags & PEP_idf_not_for_sync)) @@ -349,13 +346,9 @@ DYNAMIC_API PEP_STATUS disable_identity_for_sync(PEP_SESSION session, ident->flags = stored_ident->flags; free_identity(stored_ident); - // this is an invalid state; detect while debugging - - assert(!((ident->flags & PEP_idf_devicegroup) && (ident->flags & PEP_idf_not_for_sync))); - - // if this identity is disabled already we can end here + // if this identity is disabled and not part of a device group already we can end here - if (ident->flags & PEP_idf_not_for_sync) + if ((ident->flags & PEP_idf_not_for_sync) && !(ident->flags & PEP_idf_devicegroup)) return PEP_STATUS_OK; // if the identity is not part of a device group just disable it to keep this