-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
enhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Description
Summary
Refactoring opportunities for the v2 implementation related to task properties and TypeScript type definitions.
Motivation and Context
The current implementation has some patterns that could be improved for better code organization and type safety.
Proposed Changes
1. Group task-related properties
Currently there are multiple taskX variables at the same level:
taskId?: string;
taskStore?: RequestTaskStore;
taskRequestedTtl?: number | null;Consider grouping these under a single task object:
task?: {
id: string;
store: RequestTaskStore;
requestedTtl: number | null;
};This provides better organization and makes it clearer these properties are related.
2. Distinguish between optional properties and undefined values
In TypeScript:
// Property may be omitted entirely
{ prop?: string; }
// Property must be present, but can be undefined
{ prop: string | undefined; }These have different semantics:
prop?: string- the property may not exist at allprop: string | undefined- the property always exists but may beundefined
We should audit the codebase and use the appropriate pattern based on actual intent. This affects:
- API contracts (what callers must provide)
- Serialization behavior (omitted vs explicit
undefined) - Type narrowing (
inchecks vs value checks)
Additional context
Low priority - should be addressed if time permits during v2 development.
Metadata
Metadata
Assignees
Labels
enhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes