Skip to content

Commit

Permalink
fix: do not warn for unset disabled property change (#13509) (#13515) (
Browse files Browse the repository at this point in the history
…#13519)

Do not log a waning if getting a
property change for a disabled
component when that property has
not been set for the component.

Fixes vaadin/flow-components#2490

Co-authored-by: caalador <mikael.grankvist@vaadin.com>

Co-authored-by: Marco Collovati <marco@vaadin.com>
Co-authored-by: caalador <mikael.grankvist@vaadin.com>
  • Loading branch information
3 people committed Apr 13, 2022
1 parent 7825a00 commit e616032
Showing 1 changed file with 15 additions and 4 deletions.
Expand Up @@ -20,6 +20,7 @@
import java.util.List;
import java.util.Optional;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.vaadin.flow.component.Component;
Expand Down Expand Up @@ -112,10 +113,20 @@ protected Optional<Runnable> handleNode(StateNode node,
return enqueuePropertyUpdate(node, invocationJson, feature,
property);
} else {
LoggerFactory.getLogger(MapSyncRpcHandler.class)
.warn("Property update request for disabled element is received from the client side. "
+ "The property is '{}'. Request is ignored.",
property);
final Logger logger = LoggerFactory
.getLogger(MapSyncRpcHandler.class);
if (node.getFeatureIfInitialized(ElementPropertyMap.class)
.map(feat -> feat.getProperty(property))
.orElse(null) != null) {
logger.warn(
"Property update request for disabled element is received from the client side. "
+ "The property is '{}'. Request is ignored.",
property);
} else {
logger.debug(
"Ignored property '{}' change for disabled element. Most likely client sent the default value as no value has been set for the property.",
property);
}
}
return Optional.empty();
}
Expand Down

0 comments on commit e616032

Please sign in to comment.