fix(qgroup): non-atomic group get must read channel-less Const fields
A non-atomic group get (record[atomic=false]) gated each field read on `pDbChannel && leafNode`, so fields with no dbChannel were silently skipped. MappingInfo::Const fields carry a constant value rather than a channel, so a non-atomic get returned them at their cloneEmpty() defaults (0 / 0.0 / ""), while the atomic get and monitor paths return the constant. Mirror the atomic branch's field selection in the non-atomic branch: skip only Proc/Structure and read every other field, taking the per-field DBLocker only when a channel is present. getGroupField() already handles channel-less fields via field.info, so Const fields populate correctly.
This commit is contained in:
committed by
Michael Davidsaver
parent
5b5ce4b28f
commit
0eebeb8d79
+7
-4
@@ -510,17 +510,20 @@ void onGet(Group& group, const std::unique_ptr<server::ExecOp>& getOperation) {
|
||||
|
||||
// Loop through all fields
|
||||
for (auto& field: group.fields) {
|
||||
dbChannel* pDbChannel = field.value;
|
||||
if(field.info.type == MappingInfo::Proc || field.info.type==MappingInfo::Structure)
|
||||
continue;
|
||||
|
||||
// find the leaf node in which to set the value
|
||||
auto leafNode = field.findIn(returnValue);
|
||||
|
||||
if (pDbChannel && leafNode) {
|
||||
if (dbChannel* pDbChannel = field.value) {
|
||||
// Lock this field
|
||||
DBLocker F(pDbChannel->addr.precord);
|
||||
if (!getGroupField(field, leafNode, group.name, getOperation)) {
|
||||
if(!getGroupField(field, leafNode, group.name, getOperation))
|
||||
return;
|
||||
} else {
|
||||
if(!getGroupField(field, leafNode, group.name, getOperation))
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user