fix(directory): Fix SharedDirectory.forEach() (#25299)#25301
fix(directory): Fix SharedDirectory.forEach() (#25299)#25301scottn12 merged 1 commit intomicrosoft:release/client/2.53from
SharedDirectory.forEach() (#25299)#25301Conversation
## Description This PR fixes `SharedDirectory.forEach()` as it no longer tries to unbox the value. It also adds a test to prevent this regression in the future.
|
Warning WARNING: This PR is targeting a release branch! All changes must first be merged into Changes to release branches require approval from the Patch Triage group before merging. For more details, see our internal documentation for the patch policy and processes for |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in SharedDirectory.forEach() where the callback was incorrectly receiving the internal value object instead of the actual stored value. The fix ensures that forEach() properly passes the unwrapped value to the callback function.
Key changes:
- Fixed the
forEach()implementation to pass the correct value parameter - Added comprehensive test coverage for the
forEach()method
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/dds/map/src/directory.ts | Fixed forEach() to pass localValue directly instead of accessing .value property |
| packages/dds/map/src/test/mocha/directory.spec.ts | Added test case to verify forEach() iterates correctly over directory entries |
This PR cherry-picks 1b1514f from main to fix a bug with
SharedDirectory.forEach().