Skip to content

Standardize Handling of None/Null CheckpointToken #43

@yaythomas

Description

@yaythomas

Context

GitHub Reference: lambda_service.py#L833

Standardize how None/null CheckpointToken values are handled throughout the system. Align with TypeScript.

Technical Requirements

  • Define consistent behavior for null checkpoint tokens
  • Update all checkpoint token handling code
  • Ensure proper validation and error messages
  • Handle edge cases in token lifecycle

Implementation Details

  • File: src/aws_durable_execution_sdk_python/lambda_service.py
  • Line: Around line 833
  • Validation: Add null checks and appropriate defaults
def handle_checkpoint_token(self, token: str | None) -> str:
    """Standardize checkpoint token handling."""
    if token is None:
        # Define standard behavior for null tokens
        logger.warning("Checkpoint token is None, using empty string")
        return ""

        # OR?
        # raise FatalError(f"Checkpoint token must be string, got {type(token)}")
    
    return token.strip()  # Normalize whitespace

Acceptance Criteria

  • Align with TypeScript on behavior
  • Consistent null token handling across codebase
  • Clear validation and error messages
  • Edge cases properly handled
  • Behavior is documented
  • Tests cover null token scenarios

Priority: Low
Estimated Effort: 0.5 day

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions