Skip to content

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Aug 24, 2025

Instant's value now correctly prints as an EPOCH number

Motivation:

A regression was introduced by #540. The HTTP headers returned by LocalServer contained an invalid representation of the Lamba Deadline.

See #551

Modifications:

  • Add CustomStringConvertible to LambdaClock.Instant to just print the Int64 value
  • add a unit test

Result:

The runtime works correctly with the new LambdaClock

@sebsto sebsto added this to the 2.0 milestone Aug 24, 2025
@sebsto sebsto self-assigned this Aug 24, 2025
@sebsto sebsto added the 🔨 semver/patch No public API change. label Aug 24, 2025
@sebsto
Copy link
Contributor Author

sebsto commented Aug 24, 2025

As all CI check pass, and this is a trivial bug fix, I will merge without further review.

@sebsto sebsto requested a review from Copilot August 24, 2025 11:34
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 pull request fixes a regression in the Lambda deadline header representation by implementing CustomStringConvertible for LambdaClock.Instant to correctly output epoch values as plain numbers instead of the default struct representation.

  • Adds CustomStringConvertible conformance to LambdaClock.Instant with a description property that returns the epoch milliseconds as a string
  • Includes a comprehensive unit test to verify the string representation contains only numeric characters and can be converted back to a valid instant

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Sources/AWSLambdaRuntime/LambdaClock.swift Implements CustomStringConvertible with description property returning epoch milliseconds
Tests/AWSLambdaRuntimeTests/LambdaClockTests.swift Adds unit test validating instant string representation as numeric epoch value

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sebsto sebsto merged commit 323b3f2 into swift-server:main Aug 24, 2025
35 checks passed
@sebsto sebsto deleted the sebsto/fix_instant_in_headers branch August 24, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant