Skip to content

Replace std::time::Instant in Cloudflare-reachable core code #1075

Description

@jevansnyc

Follow-up from PR #1074 review. std::time::Instant::now() panics on wasm32-unknown-unknown (the Cloudflare adapter's target); the timing paths added in #1074 now use web_time::Instant, but two pre-existing core call sites remain in Cloudflare-reachable code:

  • crates/trusted-server-core/src/auction/telemetry.rs (std::time::Instant import)
  • crates/trusted-server-core/src/integrations/datadome/protection_scope.rs (std::time::Instant import)

Each will trap the worker if reached on Cloudflare. web-time is already a workspace dependency and re-exports std's Instant on non-wasm targets, so the fix is an import swap per site plus confirmation that nothing compares these instants against std ones.

Note for CI: these paths are not exercised by the Cloudflare integration fixture ([auction] enabled = false, no DataDome), which is why compile-and-native-test gates stay green. A workerd-runtime test with auctions enabled would close that structural gap.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    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