temporalio / temporalio/sdk-java
`startUpdate` JavaDoc says "asynchronously" when it may not be
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
- Look at JavaDoc for
startUpdate - Assume
startUpdateis always asynchronous - Call
startUpdatewith awaitForStageofWorkflowUpdateStage.COMPLETED - See that the
startUpdatecall 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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