Skip to content

Expose explicit reset APIs for all Lazy-backed caches in OpcUaClient#1710

Merged
kevinherron merged 3 commits intomainfrom
copilot/add-reset-methods-for-lazy-fields
Feb 26, 2026
Merged

Expose explicit reset APIs for all Lazy-backed caches in OpcUaClient#1710
kevinherron merged 3 commits intomainfrom
copilot/add-reset-methods-for-lazy-fields

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

OpcUaClient had several Lazy-backed cached fields without a corresponding public reset API. This change makes cache invalidation explicit and complete by adding public reset methods for every Lazy field on the client.

  • API surface: add missing reset methods for all Lazy caches

    • Added:
      • resetOperationLimits()
      • resetDynamicDataTypeManager()
      • resetDynamicEncodingContext()
      • resetDataTypeTree()
      • resetObjectTypeTree()
      • resetVariableTypeTree()
  • Internal consistency: route existing invalidation paths through new APIs

    • Updated existing reset call sites to use the new public methods (e.g. read*Tree(), readOperationLimits(), factory setters), so behavior remains aligned while exposing the same invalidation controls externally.
public void resetDataTypeTree() {
  dataTypeTree.reset();
}

public void resetDynamicDataTypeManager() {
  dynamicDataTypeManager.reset();
}

> [!WARNING]
>
>


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: kevinherron <340273+kevinherron@users.noreply.github.com>
Copilot AI changed the title [WIP] Add reset methods for Lazy instances in OpcUaClient Expose explicit reset APIs for all Lazy-backed caches in OpcUaClient Feb 26, 2026
Copy link
Contributor

@kevinherron kevinherron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpcUaClientResetMethodsTest is unnecessary, remove it.

Co-authored-by: kevinherron <340273+kevinherron@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 26, 2026

OpcUaClientResetMethodsTest is unnecessary, remove it.

Done in 88cb7a1 — I removed OpcUaClientResetMethodsTest from sdk-client as requested.

@kevinherron kevinherron marked this pull request as ready for review February 26, 2026 13:36
@kevinherron kevinherron requested a review from Copilot February 26, 2026 13:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request exposes public reset methods for all Lazy-backed cache fields in OpcUaClient, providing explicit cache invalidation APIs that were previously missing. The changes enhance the public API surface by allowing external consumers to explicitly invalidate caches when needed.

Changes:

  • Added 6 new public reset methods (resetOperationLimits(), resetDynamicDataTypeManager(), resetDynamicEncodingContext(), resetDataTypeTree(), resetObjectTypeTree(), resetVariableTypeTree())
  • Updated existing internal reset call sites to use the new public methods for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kevinherron kevinherron merged commit 50677dc into main Feb 26, 2026
10 checks passed
@kevinherron kevinherron added this to the 1.1.1 milestone Feb 26, 2026
@kevinherron kevinherron modified the milestones: 1.1.1, 1.1.2 Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants