Skip to content

Conversation

@Aaronontheweb
Copy link
Member

Summary

Backport of #7911 to v1.5 branch.

Fixed a bug where LWWDictionary.Delta would throw ArgumentNullException when the underlying ORDictionary.Delta is null, which is a legitimate state after initialization or calling ResetDelta().

Changes

  • Modified LWWDictionary.Delta property to return null when Underlying.Delta is null
  • Added test Bugfix_7910_LWWDictionary_Delta_should_handle_null_underlying_delta to verify the fix

Root Cause

The LWWDictionary.Delta property was unconditionally wrapping Underlying.Delta in a LWWDictionaryDelta constructor, which throws ArgumentNullException when passed null. However, ORDictionary.Delta can legitimately return null after construction or ResetDelta().

The Replicator expects deltas to be nullable (uses ?? operator), so this fix aligns LWWDictionary with the expected interface contract.

Test Evidence

All LWWDictionarySpec tests pass:

  • 5 existing tests (no regressions)
  • 1 new test verifying null delta handling

Fixes #7910 for v1.5

…s null (akkadotnet#7910) (akkadotnet#7911)

## Summary
Fixed a bug where LWWDictionary.Delta would throw ArgumentNullException when the underlying ORDictionary.Delta is null, which is a legitimate state after initialization or calling ResetDelta().

## Changes
- Modified LWWDictionary.Delta property to return null when Underlying.Delta is null
- Added test Bugfix_7910_LWWDictionary_Delta_should_handle_null_underlying_delta to verify the fix

## Root Cause
The LWWDictionary.Delta property was unconditionally wrapping Underlying.Delta in a LWWDictionaryDelta constructor, which throws ArgumentNullException when passed null. However, ORDictionary.Delta can legitimately return null after construction or ResetDelta().

The Replicator expects deltas to be nullable (uses ?? operator at lines 665 and 685), so this fix aligns LWWDictionary with the expected interface contract.

Fixes akkadotnet#7910
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) October 16, 2025 21:02
@Aaronontheweb Aaronontheweb merged commit eb020d0 into akkadotnet:v1.5 Oct 16, 2025
11 checks passed
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.

1 participant