[ntcore] Output warning on property set on unpublished topic (#5059)

Previously this was a debug-level message. This can primarily impact
users who call SetPersistent() on an entry before calling SetDefault().
This commit is contained in:
Peter Johnson
2023-02-05 11:57:29 -08:00
committed by GitHub
parent 84cbd48d84
commit 19267bef0c

View File

@@ -599,13 +599,17 @@ void ClientData4Base::ClientSetProperties(std::string_view name,
auto topicIt = m_server.m_nameTopics.find(name);
if (topicIt == m_server.m_nameTopics.end() ||
!topicIt->second->IsPublished()) {
DEBUG3("ignored SetProperties from {} on non-existent topic '{}'", m_id,
name);
WARNING(
"server ignoring SetProperties({}) from client {} on unpublished topic "
"'{}'; publish or set a value first",
update.dump(), m_id, name);
return; // nothing to do
}
auto topic = topicIt->second;
if (topic->special) {
DEBUG3("ignored SetProperties from {} on meta topic '{}'", m_id, name);
WARNING(
"server ignoring SetProperties({}) from client {} on meta topic '{}'",
update.dump(), m_id, name);
return; // nothing to do
}
m_server.SetProperties(nullptr, topic, update);