Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upsertMemo command #119

Open
5 of 7 tasks
lorensr opened this issue Aug 10, 2022 · 6 comments
Open
5 of 7 tasks

Add upsertMemo command #119

lorensr opened this issue Aug 10, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@lorensr
Copy link
Contributor

lorensr commented Aug 10, 2022

Is your feature request related to a problem? Please describe.

User would like to edit memo from inside the Workflow, like upsertSearchAttributes

https://temporalio.slack.com/archives/C01DKSMU94L/p1659963126631549

Describe the solution you'd like

import { upsertMemo } from '@temporalio/workflow'

function myWorkflow() {
  upsertMemo({ newField: 'foo', changeExistingField: 'bar' })
}

SDKs

@bergundy
Copy link
Member

How would I delete an existing field?

@dnr
Copy link
Member

dnr commented Aug 16, 2022

Set it to null. We support this for search attributes now with temporalio/temporal#3047.

@bergundy
Copy link
Member

Requires an sdk-features issue plus spec.
I'd like us to think what the behavior's going to be when we allow modifying the memo externally.
It could be as simple as "last writer wins" as long as the server is responsible for merging partial upserts IMHO, others have raise a need for an update token but I don't think that's necessary here.

@bergundy
Copy link
Member

Set it to null. We support this for search attributes now with temporalio/temporal#3047.

We'd have to think if that's the desired experience per SDK, we might want a deleteMemoFields helper, we'll decide at implementation time.

@bergundy bergundy transferred this issue from temporalio/temporal Aug 17, 2022
@bergundy
Copy link
Member

Moved to sdk-features

@bergundy
Copy link
Member

From the Go PR, we should discuss the behavior in SDK:

Didn't look at the code but something I wish we'd done with search attributes in TS is delay sending the command until the end of an "activation", so if a user calls UpsertMemo({ a: 1 }); UpsertMemo({ b: 2 }); UpsertMemo({ a: 2 }) the SDK would only issue 1 UpsertMemo({ a: 2, b: 2}) command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants