temporalio / temporalio/sdk-java

`startUpdate` JavaDoc says "asynchronously" when it may not be

Open
#2,578 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
433
Forks
249
Avg merge
5d 6h
Merged PRs (30d)
26

Description

Expected Behavior

The JavaDoc for startUpdate should indicate that when it's called with a waitForStage of WorkflowUpdateStage.COMPLETED, it's synchronous and blocks until the update is completed.

Actual Behavior

The JavaDoc for startUpdate says the following:

Start a zero argument update workflow request asynchronously.

However, the following code will block until the update is completed:

val updateOptions =
  UpdateOptions.newBuilder<UpdateResult>()
    .setResultClass(UpdateResult::class.java)
    .setWaitForStage(WorkflowUpdateStage.COMPLETED)
    .setUpdateId(updateId)
    .build()
val update = WorkflowClient.startUpdate(stub::doUpdate, updateOptions) // <-- blocks here
val result = update.getResult(5, TimeUnit.SECONDS)

The JavaDoc implies that startUpdate would ignore the waitForStage, always be asynchronous, and block on the update.getResult.

Steps to Reproduce the Problem

  1. Look at JavaDoc for startUpdate
  2. Assume startUpdate is always asynchronous
  3. Call startUpdate with a waitForStage of WorkflowUpdateStage.COMPLETED
  4. See that the startUpdate call was actually synchronous

Specifications

  • Version: latest master
  • Platform: n/a

Requesting that either the word asynchronously is removed from the JavaDoc for the startUpdate methods or it's clear that the function isn't asynchronous in a normal sense.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open temporal-sdk/src/main/java/io/temporal/client/WorkflowClient.java around line 704 and inspect the JavaDoc for the startUpdate methods. Check how the waitForStage option is described, then update the documentation so COMPLETED clearly indicates that the call may block; done means the JavaDoc no longer implies the method is always asynchronous.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.