Skip to content

Register subdirectory events on directory load #24781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

scarlettjlee
Copy link
Contributor

@scarlettjlee scarlettjlee commented Jun 7, 2025

When loading from snapshot, nested subdirectory create and delete events do not propagate. This change registers the events on load. AB#39281

@scarlettjlee scarlettjlee self-assigned this Jun 7, 2025
@Copilot Copilot AI review requested due to automatic review settings June 7, 2025 07:47
@github-actions github-actions bot added area: dds Issues related to distributed data structures base: main PRs targeted against main branch labels Jun 7, 2025
Copy link
Contributor

@Copilot 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 PR addresses the propagation issue of nested subdirectory creation and deletion events during snapshot loads. Key changes include adding a new test to validate event registration on load, integrating event registration within subdirectory population, and fixing a spelling typo in the comments.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/dds/map/src/test/mocha/directory.spec.ts Added a new test case to verify that subdirectory events propagate.
packages/dds/map/src/directory.ts Registered subdirectory events on load and fixed a spelling typo.
Comments suppressed due to low confidence (1)

packages/dds/map/src/directory.ts:2017

  • [nitpick] A brief inline comment explaining the purpose of calling registerEventsOnSubDirectory here would improve code clarity.
this.registerEventsOnSubDirectory(newSubDir, subdirName);

assert(subdir, "child subdirectory should exist");

let subDirectoryCreatedEventCounts = 0;
loadedDirectory.on("subDirectoryCreated", (path, _local, _target) => {
Copy link
Preview

Copilot AI Jun 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using assert.strictEqual for validating event count values to ensure a type-safe comparison, in line with other assertions in this test file.

Copilot uses AI. Check for mistakes.

@scarlettjlee scarlettjlee merged commit c7ac860 into microsoft:main Jun 9, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds Issues related to distributed data structures base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants