Skip to content

WaitForCondition: round-trip initialState through SerDes before first check #671

Closed

Description

@ayushiahjolia

In the Python SDK, wait_for_condition round-trips initial_state through the configured serdes before the first check runs, so the check sees the same serialized-then-deserialized shape on every poll. The Java SDK currently passes config.initialState() raw into the first check and only normalizes the check result through SerDes afterward, so the first poll's input state differs in shape from subsequent polls (which are deserialized from the checkpoint).

Current behavior

In WaitForConditionOperation.java:

@Override
protected void start() {
    executeCheckLogic(config.initialState(), FIRST_ATTEMPT);
}

start() passes config.initialState() directly. executeCheckLogic normalizes the check result via serializeAndDeserializeResult(result.value()), and resumeCheckLoop deserializes currentState from the checkpoint - but the initial state itself is never round-tripped before the first check.

Proposed behavior

Round-trip config.initialState() through the configured SerDes before invoking the first check, so the check observes a consistent shape on every attempt and non-serializable initial state fails fast.

Updated docs repo with the change as well.

Activity

  1. added
    bugSomething isn't working
    parityProvides parity with other language implementations of the SDK
    on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparityProvides parity with other language implementations of the SDKpkg:sdkModule: sdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions