diff --git a/src/lib/cache/subCache.cpp b/src/lib/cache/subCache.cpp index d19bd7b201..23b1af6c8c 100644 --- a/src/lib/cache/subCache.cpp +++ b/src/lib/cache/subCache.cpp @@ -452,6 +452,12 @@ static bool subMatch ngsiv2::SubAltType targetAltType ) { + // If notifyOnMetadataChange is false and only metadata has been changed, we "downgrade" to ngsiv2::EntityUpdate + if (!cSubP->notifyOnMetadataChange && (targetAltType == ngsiv2::EntityChangeOnlyMetadata)) + { + targetAltType = ngsiv2::EntityUpdate; + } + // Check alteration type if (!matchAltType(cSubP, targetAltType)) { @@ -490,12 +496,6 @@ static bool subMatch return false; } - // If notifyOnMetadataChange is false and only metadata has been changed, we "downgrade" to ngsiv2::EntityUpdate - if (!cSubP->notifyOnMetadataChange && (targetAltType == ngsiv2::EntityChangeOnlyMetadata)) - { - targetAltType = ngsiv2::EntityUpdate; - } - // // If one of the attribute names in the scope vector // of the subscription has the same name as the incoming attribute. there is a match.