Skip to content

Commit 234615e

Browse files
committed
formatting & linting
1 parent 4205e68 commit 234615e

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

packages/test/src/test-serialization-context.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { randomUUID } from 'crypto';
22
import { WorkflowClient, WorkflowFailedError } from '@temporalio/client';
33
import { workflowInterceptorModules } from '@temporalio/testing';
44
import { bundleWorkflowCode } from '@temporalio/worker';
5+
import { decodeOptionalSinglePayload } from '@temporalio/common/lib/internal-non-workflow';
56
import { bundlerOptions, TestWorkflowEnvironment } from './helpers';
67
import {
78
makeConfigurableEnvironmentTestFn,
@@ -34,7 +35,6 @@ import {
3435
import { makeContextTrace } from './payload-converters/serialization-context-converter';
3536
import { echoTrace, heartbeatTrace } from './activities/serialization-context';
3637
import { throwAnError } from './activities';
37-
import { decodeOptionalSinglePayload } from '@temporalio/common/lib/internal-non-workflow';
3838

3939
const converterPath = require.resolve('./payload-converters/serialization-context-converter');
4040
const dataConverter = { payloadConverterPath: converterPath, failureConverterPath: converterPath };
@@ -418,9 +418,7 @@ test('timer summary still serializes', async (t) => {
418418
execution: { workflowId },
419419
});
420420

421-
const timerStarted = resp.history?.events?.find(
422-
(e) => e.timerStartedEventAttributes != null
423-
);
421+
const timerStarted = resp.history?.events?.find((e) => e.timerStartedEventAttributes != null);
424422

425423
t.is(
426424
await decodeOptionalSinglePayload(
@@ -432,7 +430,6 @@ test('timer summary still serializes', async (t) => {
432430
});
433431
});
434432

435-
436433
test('workflow with many payload boundaries', async (t) => {
437434
const h = configurableHelpers(t, t.context.workflowBundle, t.context.env);
438435
const client = makeClient(t.context.env);
@@ -569,4 +566,4 @@ test('local activity failure observed by workflow carries local activity decode
569566
const message = await handle.result();
570567
t.is(message, `failure.decode.bound|${localAct}|failure.encode.bound|${localAct}|local-activity-failure`);
571568
});
572-
});
569+
});

packages/test/src/test-worker-heartbeats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,4 @@ test('activity start heartbeat-details decode failure is encoded with activity s
206206
'failure.encode.bound|activity.worker-test.wfid.act-1.false|Failed to parse heartbeat details for activity act-1: Unknown encoding: '
207207
);
208208
});
209-
});
209+
});

packages/workflow/src/workflow.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ function currentWorkflowSerializationContext(info: WorkflowInfo): WorkflowSerial
8585
};
8686
}
8787

88-
function targetWorkflowSerializationContext(
89-
info: WorkflowInfo,
90-
workflowId: string
91-
): WorkflowSerializationContext {
88+
function targetWorkflowSerializationContext(info: WorkflowInfo, workflowId: string): WorkflowSerializationContext {
9289
return {
9390
type: 'workflow',
9491
namespace: info.namespace,
@@ -130,7 +127,10 @@ export function addDefaultWorkflowOptions<T extends Workflow>(
130127
*/
131128
function timerNextHandler({ seq, durationMs, options }: TimerInput) {
132129
const activator = getActivator();
133-
const payloadConverter = withPayloadConverterContext(activator.payloadConverter, currentWorkflowSerializationContext(activator.info));
130+
const payloadConverter = withPayloadConverterContext(
131+
activator.payloadConverter,
132+
currentWorkflowSerializationContext(activator.info)
133+
);
134134
return new Promise<void>((resolve, reject) => {
135135
const scope = CancellationScope.current();
136136
if (scope.consideredCancelled) {
@@ -1066,7 +1066,10 @@ export function makeContinueAsNewFunc<F extends Workflow>(
10661066
};
10671067

10681068
return (...args: Parameters<F>): Promise<never> => {
1069-
const payloadConverter = withPayloadConverterContext(activator.payloadConverter, currentWorkflowSerializationContext(info));
1069+
const payloadConverter = withPayloadConverterContext(
1070+
activator.payloadConverter,
1071+
currentWorkflowSerializationContext(info)
1072+
);
10701073
const fn = composeInterceptors(activator.interceptors.outbound, 'continueAsNew', async (input) => {
10711074
const { headers, args, options } = input;
10721075
throw new ContinueAsNew({
@@ -1727,7 +1730,10 @@ export function upsertSearchAttributes(searchAttributes: SearchAttributes | Sear
17271730
*/
17281731
export function upsertMemo(memo: Record<string, unknown>): void {
17291732
const activator = assertInWorkflowContext('Workflow.upsertMemo(...) may only be used from a Workflow Execution.');
1730-
const payloadConverter = withPayloadConverterContext(activator.payloadConverter, currentWorkflowSerializationContext(activator.info));
1733+
const payloadConverter = withPayloadConverterContext(
1734+
activator.payloadConverter,
1735+
currentWorkflowSerializationContext(activator.info)
1736+
);
17311737

17321738
if (memo == null) {
17331739
throw new Error('memo must be a non-null Record');

0 commit comments

Comments
 (0)