-
Notifications
You must be signed in to change notification settings - Fork 123
Schedule update search attributes #1625
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
Conversation
bf1eae3
to
d8ee220
Compare
2594115
to
f18d46c
Compare
f18d46c
to
d05f00c
Compare
@@ -142,7 +142,7 @@ export type CompiledScheduleOptions = Replace< | |||
* The specification of an updated Schedule, as expected by {@link ScheduleHandle.update}. | |||
*/ | |||
export type ScheduleUpdateOptions<A extends ScheduleOptionsAction = ScheduleOptionsAction> = Replace< | |||
Omit<ScheduleOptions, 'scheduleId' | 'memo' | 'searchAttributes' | 'typedSearchAttributes'>, | |||
Omit<ScheduleOptions, 'scheduleId' | 'memo'>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we might be better not add support for legacy (non-typed) SA on Schedule Update. I mean, we supported those elsewhere because those APIs existed before, but Schedule Update didn't had that, so why add an API here that would be immediately considered as deprecated? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that's fair, no sense in permitting something that's deprecated. I'll continue to omit searchAttributes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - this is why, the update
handler:
/**
* Update the Schedule
*
* This function calls `.describe()`, provides the `Schedule` to the provided `updateFn`, and
* sends the returned `UpdatedSchedule` to the Server to update the Schedule definition. Note that,
* in the future, `updateFn` might be invoked multiple time, with identical or different input.
*/
update<W extends Workflow = Workflow>(
updateFn: (previous: ScheduleDescription) => ScheduleUpdateOptions<ScheduleOptionsStartWorkflowAction<W>>
): Promise<void>;
To update, the user supplies a function that takes a ScheduleDescription
and returns ScheduleUpdateOptions
. ScheduleDescription
already has a searchAttributes
field.
I forgot about this.
We can have this discrepancy to force users to use typed search attributes, but I don't think this will be obvious to users until they run into unexpected behavior (i.e. update searchAttributes
from description but it doesn't actually do anything because it doesn't exist in update options).
I think I would prefer to have consistency between ScheduleDescription
and the ScheduleUpdateOptions
but am not fussy either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Let's keep it.
3221c0f
to
d05f00c
Compare
What was changed
Allow schedules to update their search attributes.
Closes [Feature Request] Support schedule search attribute update #1475
How was this tested:
Added integration test.
Any docs updates needed?
Unsure