Skip to content

Support new API fields in ActivityHandle.describe - #1782

Open
maciejdudko wants to merge 2 commits into
temporalio:mainfrom
maciejdudko:saa-describe-payloads
Open

Support new API fields in ActivityHandle.describe#1782
maciejdudko wants to merge 2 commits into
temporalio:mainfrom
maciejdudko:saa-describe-payloads

Conversation

@maciejdudko

Copy link
Copy Markdown
Contributor

What was changed

  • Added options for retrieving optional payloads in ActivityHandle.describe()
  • Removed long polling from ActivityHandle.describe()
  • Added late-deserializing methods to ActivityExecutionDescription for payload-bearing properties
  • Refactored ActivityExecutionDescription creation, added missing properties and removed properties that don't exist or shouldn't be exposed
  • Adjusted @dataclass configuration for ActivityExecution and ActivityExecutionDescription

Why?

Implements newly added API features and removes parts that were not meant to be exposed.

Checklist

  1. How was this tested:

Updated tests.test_activity.TestDescribe

@maciejdudko
maciejdudko requested a review from a team as a code owner August 24, 2026 22:33


@dataclass(frozen=True)
@dataclass(eq=False, kw_only=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you unfreezing the dataclasses?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly to allow swapping out data converter, but maybe that's wrong design. I can see the argument to keep these frozen, I'll re-add it.

info=resp.info,
long_poll_token=resp.long_poll_token or None,
# Erase unrequested fields if server sent them anyway (can happen with old server)
if not input.include_input:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a little sketchy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently (or until recently), the server sends heartbeat details and last failure unconditionally. This piece of code ensures the user has consistent view of data even if the server doesn't respect the default/false values in the request. One alternative is to keep the data in the proto but persist the include_ args in the description class and filter these out in the getters. Another is to just allow the possibility that these fields may be set anyway even if not requested. Of the three, I think erasing it from the proto is the best approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants