Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(workflow): Throw if patches are used at Workflow top level #369

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

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

bergundy
Copy link
Member

Closes #362

@bergundy bergundy requested a review from Sushisource November 10, 2021 20:19
@bergundy bergundy force-pushed the patches-before-create branch from 23e0b71 to 46ba7f2 Compare November 10, 2021 21:29
@bergundy bergundy changed the title fix(workflow): Support patches at the Workflow top level fix(workflow): Throw if patches are used at Workflow top level Nov 10, 2021
Comment on lines +602 to +606
(
j
): j is NonNullableObject<
Pick<coresdk.workflow_activation.IWFActivationJob, 'notifyHasPatch'>
> => j.notifyHasPatch != null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my god this is some nauseating formatting (I know it's auto-formatted, but, jesus)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, I can declare the type somewhere else so the formatting is fixed

Comment on lines +198 to +201
await context.evalClosure('lib.initRuntime($0, $1)', [options, isolateExtension.derefInto()], {
arguments: { copy: true },
timeout: isolateExecutionTimeoutMs,
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's nicer

const { isReplaying } = state.info;
const { isReplaying } = workflowInfo();
if (state.workflow === undefined) {
throw new IllegalStateError('Patches cannot be used before Workflow starts');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lift string to constant for assertion in test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just 1 test, I can but I wouldn't bother

@bergundy bergundy merged commit 81eb0fb into main Nov 10, 2021
@bergundy bergundy deleted the patches-before-create branch November 10, 2021 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Patches should be applied to workflow before workflow code is required
2 participants