temporalio / temporalio/features
[Feature Request] Expose UpdateID in an update handler
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 32
- Forks
- 28
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
Is your feature request related to a problem? Please describe.
Add a way for users to obtain an update requests UpdateID in a handler.
Describe the solution you'd like
In Go I would implement it through Info call like GetUpdateInfo
func Counter(ctx workflow.Context) (int, error) {
log := workflow.GetLogger(ctx)
counter := 0
if err := workflow.SetUpdateHandlerWithOptions(
ctx,
FetchAndAdd,
func(ctx workflow.Context, i int) (int, error) {
updateID := workflow.GetUpdateInfo(ctx).UpdateID
tmp := counter
counter += i
log.Info("counter updated", "addend", i, "new-value", counter, "update ID", updateID)
return tmp, nil
},
workflow.UpdateHandlerOptions{Validator: nonNegative},
); err != nil {
return 0, err
}
Additional context
We should also consider adding UpdateID to the interceptors as well
- Go
- Java
- TypeScript - https://github.com/temporalio/sdk-typescript/issues/1317
- Python
- .NET
- Php
- Ruby
Contributor guide
No contributing guide indexed for this repository
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
Start with the Go workflow update-handler entry point, SetUpdateHandlerWithOptions, and the existing GetUpdateInfo pattern shown in the request. Check how update handlers expose request context and how interceptors are represented. Done means a handler can obtain its UpdateID, with the interceptor addition resolved or explicitly scoped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100