mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-26 04:19:53 +08:00
Fix missing FactoryBuilder.Commit() in dictionary-based complex type loading paths (#3630)
* Fix missing Commit() after LoadDictionaryDataTypesAsync in ComplexTypeSystem Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
This commit is contained in:
@@ -264,6 +264,7 @@ namespace Opc.Ua.Client.ComplexTypes
|
||||
serverStructTypes = [.. serverStructTypes.Where(
|
||||
rd => rd.NodeId.NamespaceIndex == nameSpaceIndex)];
|
||||
// load types
|
||||
bool allTypesLoaded;
|
||||
if (DisableDataTypeDefinition ||
|
||||
!await LoadBaseDataTypesAsync(serverEnumTypes, serverStructTypes, ct)
|
||||
.ConfigureAwait(false))
|
||||
@@ -272,12 +273,16 @@ namespace Opc.Ua.Client.ComplexTypes
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return await LoadDictionaryDataTypesAsync(serverEnumTypes, false, ct)
|
||||
allTypesLoaded = await LoadDictionaryDataTypesAsync(serverEnumTypes, false, ct)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
allTypesLoaded = true;
|
||||
}
|
||||
// Commit the changes to the factory
|
||||
m_complexTypeResolver.FactoryBuilder.Commit();
|
||||
return true;
|
||||
return allTypesLoaded;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -338,6 +343,7 @@ namespace Opc.Ua.Client.ComplexTypes
|
||||
: (await m_complexTypeResolver
|
||||
.LoadDataTypesAsync(DataTypeIds.Structure, true, ct: ct)
|
||||
.ConfigureAwait(false)).ToList();
|
||||
bool allTypesLoaded;
|
||||
if (DisableDataTypeDefinition ||
|
||||
!await LoadBaseDataTypesAsync(serverEnumTypes, serverStructTypes, ct)
|
||||
.ConfigureAwait(false))
|
||||
@@ -346,12 +352,16 @@ namespace Opc.Ua.Client.ComplexTypes
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return await LoadDictionaryDataTypesAsync(serverEnumTypes, true, ct)
|
||||
allTypesLoaded = await LoadDictionaryDataTypesAsync(serverEnumTypes, true, ct)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
allTypesLoaded = true;
|
||||
}
|
||||
// Commit the changes to the factory
|
||||
m_complexTypeResolver.FactoryBuilder.Commit();
|
||||
return true;
|
||||
return allTypesLoaded;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user