Skip to content

Task polling echoes the original task's context instead of the poll request's #1574

Description

@bokelley

Version: adcp 9.0.0b4

Observed: tasks/get / get_task_status returns the context of the request that created the task. TaskRecord projects request_context as out["context"] (adcp/decisioning/task_registry.py, around line 224). Because the response then already has a context, inject_context does not echo the poll request's own.

Expected: context is per-request ("Per-request opaque caller-supplied correlation object echoed unchanged in the response"). A poll that carries context should get its own back. If the original task's context is useful to pollers, it belongs inside the task's result, not in the poll response's top-level context.

Related: a poll of a task with no progress should omit progress rather than send "progress": null, which fails validate_response("tasks_get", ...) (/progress: expected type 'object'). That was in an adopter's own shim; worth checking the SDK's projection does the same.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions