Skip to content

improvement(client-ordered-collection): ConsensusQueueFactory generic#27497

Open
jason-ha wants to merge 1 commit into
microsoft:mainfrom
jason-ha:dds/ordered-collection/ConsensusQueueFactoryTyping
Open

improvement(client-ordered-collection): ConsensusQueueFactory generic#27497
jason-ha wants to merge 1 commit into
microsoft:mainfrom
jason-ha:dds/ordered-collection/ConsensusQueueFactoryTyping

Conversation

@jason-ha
Copy link
Copy Markdown
Contributor

@jason-ha jason-ha commented Jun 5, 2026

  • Remove unused IConsensusOrderedCollectionFactory
  • Make ConsensusQueueFactory generic (assumes unknown)
    • Get specific on create & load return types
  • Remove most intended internal class use in test

- Remove unused `IConsensusOrderedCollectionFactory`
- Make `ConsensusQueueFactory` generic (assumes `unknown`)
  - Get specific on `create` & `load` return types
- Remove most intended internal class use in test
Copilot AI review requested due to automatic review settings June 5, 2026 18:59
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (115 lines, 5 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the ordered-collection DDS factory to be generic, removes the now-unneeded IConsensusOrderedCollectionFactory type, and adjusts tests/fuzz utilities to rely less on internal classes and more on public legacy typings.

Changes:

  • Removed IConsensusOrderedCollectionFactory from interfaces.ts and public exports.
  • Made ConsensusQueueFactory generic and tightened create/load return types.
  • Updated tests/fuzz utilities to use ConsensusQueueFactory<T> and legacy imports/types.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/dds/ordered-collection/src/test/fuzzUtils.ts Updates fuzz model/state typings to use ConsensusQueueFactory<T>.
packages/dds/ordered-collection/src/test/consensusOrderedCollection.spec.ts Switches test typings/imports to legacy public interfaces and adjusts class generics.
packages/dds/ordered-collection/src/interfaces.ts Removes the IConsensusOrderedCollectionFactory interface definition.
packages/dds/ordered-collection/src/index.ts Stops exporting IConsensusOrderedCollectionFactory.
packages/dds/ordered-collection/src/consensusOrderedCollectionFactory.ts Introduces generic ConsensusQueueFactory<T> and updates ConsensusQueue shared-object-kind export.

Comment on lines +79 to +82
export const ConsensusQueue = createSharedObjectKind<IConsensusOrderedCollection>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: #22835 Use unknown instead of any (breaking change)
ConsensusQueueFactory<any>,
);
Comment on lines 8 to 13
ConsensusResult,
type IConsensusOrderedCollection,
type IConsensusOrderedCollectionEvents,
type IConsensusOrderedCollectionFactory,
type IOrderedCollection,
type ISnapshotable,
} from "./interfaces.js";
Comment on lines +28 to +30
export class ConsensusQueueFactory<T>
implements IChannelFactory<IConsensusOrderedCollection<T>>
{
};

type FuzzTestState = DDSFuzzTestState<ConsensusQueueFactory>;
type FuzzTestState = DDSFuzzTestState<ConsensusQueueFactory<string>>;
*/
export const baseConsensusOrderedCollectionModel: DDSFuzzModel<
ConsensusQueueFactory,
ConsensusQueueFactory<unknown>,
Comment on lines +113 to +118
creator: () => IConsensusOrderedCollection &
SharedObjectCore<IConsensusOrderedCollectionEvents<unknown>>,
processMessages: () => void,
): void {
let testCollection: ConsensusOrderedCollection;
let testCollection: IConsensusOrderedCollection &
SharedObjectCore<IConsensusOrderedCollectionEvents<unknown>>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants