Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extract ProgressManager and TimeoutManager from Protocol
Extracts progress tracking and timeout management functionality from the
Protocolclass into dedicatedProgressManagerandTimeoutManagerclasses, following the Single Responsibility Principle.Motivation and Context
The
Protocolclass was handling multiple responsibilities including:_progressHandlersand_taskProgressTokensmaps_timeoutInfomap and_setupTimeout/_resetTimeout/_cleanupTimeoutmethodsThis change extracts these concerns into separate manager classes to:
ProtocolclassHow Has This Been Tested?
Breaking Changes
None. This is an internal refactoring:
ProgressCallbacktype is still exported from the same locationProtocolclass public API is unchangedProgressManagerandTimeoutManagerclasses are now exported (additive, non-breaking)TimeoutInfo,TimeoutOptions, andTimeoutResetResulttypes are now exported (additive, non-breaking)Types of changes
Note: This is technically a refactoring, but marked as bug fix since it improves code maintainability without adding new features or breaking existing functionality.
Checklist
Additional context
Files Changed
packages/core/src/shared/progressManager.tsProgressManagerclasspackages/core/src/shared/timeoutManager.tsTimeoutManagerclasspackages/core/src/shared/protocol.tspackages/core/src/index.tsprogressManager.tsandtimeoutManager.tspackages/core/test/shared/protocol.test.ts_progressManagerProgressManager API
TimeoutManager API
Design Decisions
#private fields - Modern ES private field syntax for true encapsulation