Skip to content

Commit e283b89

Browse files
authored
chore: Update CHANGELOG for v1.5 (#991)
1 parent b362e94 commit e283b89

File tree

1 file changed

+158
-0
lines changed

1 file changed

+158
-0
lines changed

CHANGELOG.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,164 @@ All notable changes to this project will be documented in this file.
44

55
Breaking changes marked with a :boom:
66

7+
## [1.5.0] - 2022-12-07
8+
9+
### Features
10+
11+
- [`client`] The experimental `WorkflowHandle.fetchHistory` function can now be used to easily obtain a single
12+
Workflow execution's history ([#974](https://github.com/temporalio/sdk-typescript/pull/974)).
13+
14+
- [`client`] Introduced (experimental) high level API to list workflows ([#942](https://github.com/temporalio/sdk-typescript/pull/942),
15+
[#974](https://github.com/temporalio/sdk-typescript/pull/974)):
16+
17+
```ts
18+
for await (const workflowInfo of client.workflow.list({ query: 'WorkflowType="MySuperCoolWorkflow"' })) {
19+
console.log(`${workflowInfo.workflowId} ${workflowInfo.runId}`);
20+
}
21+
```
22+
23+
The same API can also be used to efficiently obtain a list of workflows histories. Multiple histories are fetched from
24+
the server in parallel (up to `concurrency`, defaults to 5), which may improve performances.
25+
26+
```ts
27+
for await (const { workflowId, history } of client.workflow.list().intoHistories({ concurrency: 10 })) {
28+
// ...
29+
}
30+
```
31+
32+
- [`client`] Added (experimental) high level API to work with Schedules ([#937](https://github.com/temporalio/sdk-typescript/pull/937),
33+
[#960](https://github.com/temporalio/sdk-typescript/pull/960)):
34+
35+
```ts
36+
// Define a schedule that will start workflow 'RefreshClientTableWorkflow` every day at 5 AM and 1 PM
37+
await client.schedule.create({
38+
scheduleId: `refresh-client-table-every-morning`,
39+
spec: {
40+
calendars: [{ hour: [5, 13] }],
41+
},
42+
action: {
43+
type: 'startWorkflow',
44+
workflowType: 'RefreshClientTableWorkflow',
45+
taskQueue,
46+
},
47+
});
48+
```
49+
50+
Note that Schedules requires Temporal version 1.18 or later.
51+
52+
- [`core`] Core's (experimental) telemetry options are now more configurable ([#963](https://github.com/temporalio/sdk-typescript/pull/963),
53+
[#977](https://github.com/temporalio/sdk-typescript/pull/977)). Notably, filters can now be specified independently
54+
for `logging` (applicable to both `console` and `forward` loggers) and `tracing`. Function `makeTelemetryFilterString`
55+
can be used to easily build filter strings. Also, OTel metrics export interval can now be modified (defaults to 1
56+
second).
57+
58+
Note: the `TelemetryOptions` interface has changed quite a bit. Using appropriate new options is highly recommended.
59+
Backward compatibility for legacy options is provided, to the extent possible, but these legacy options have been
60+
deprecated.
61+
62+
- [`client`] WorkflowClient now supports a simpler way to define interceptors ([#956](https://github.com/temporalio/sdk-typescript/pull/956)).
63+
Interceptors should now be provided as an array of interceptor object, rather than an array of factory to those
64+
objects under a field named `calls`. Former definition syntax is still supported, though deprecated.
65+
66+
**BEFORE**
67+
68+
```ts
69+
interceptors: {
70+
calls: [
71+
(workflowId) => {
72+
create(...) => { ... }
73+
}
74+
]
75+
}
76+
```
77+
78+
**AFTER**
79+
80+
```ts
81+
interceptors: [
82+
{
83+
create(...) => { ... }
84+
}
85+
]
86+
```
87+
88+
- [`worker`] Introduced an experimental API to efficiently replay a large number of workflow histories. Teams may
89+
notably use this API to validate that changes to their workflow code will not cause non-determinism errors on existing
90+
workflow instances, before rolling out these changes to production ([#920](https://github.com/temporalio/sdk-typescript/pull/920),
91+
[#974](https://github.com/temporalio/sdk-typescript/pull/974)).
92+
93+
**EXAMPLE USAGE**
94+
95+
```ts
96+
const histories = client.workflow.list({ query: 'WorkflowType="MyWorkflow"' }).intoHistories({ concurrency: 10 });
97+
const replayResults = await Worker.runReplayHistories(
98+
{
99+
workflowsPath: require.resolve('./workflows'),
100+
// ...
101+
},
102+
histories
103+
);
104+
console.log(`Found ${replayResults.errors.length} replay errors`);
105+
```
106+
107+
- Added `activity_task_received` metric ([#439](https://github.com/temporalio/sdk-core/pull/439))
108+
109+
### Bug Fixes
110+
111+
- [`workflow`] Don't fail workflow task if a query handler was not found ([#932](https://github.com/temporalio/sdk-typescript/pull/932)).
112+
113+
- [`worker`] Wait for worker shutdown if `runUntil` promise throws ([#943](https://github.com/temporalio/sdk-typescript/pull/943)).
114+
Previously, `Worker.runUntil` would not wait for worker to complete its shutdown if the inner `fnOrPromise` threw an
115+
error. Now, it will always wait for both worker shutdown AND the inner `fnOrPromise` to resolve. If either one throw
116+
an error, then that error is rethrown. If _both_ throw an error, a `CombinedWorkerRunError` will be thrown instead,
117+
with a `cause` attribute containing both errors.
118+
119+
- The (experimental) `FailureConverter` type now receives its `PayloadConverter` through an argument on convertion
120+
methods, rather than through an option supplied at construction time ([#936](https://github.com/temporalio/sdk-typescript/pull/936)).
121+
This provides a more predictable behaviour in the common case of using the default failure converter. More over,
122+
`FailureConverter.errorToFailure` function's return type has been lossen, so that it supports greater customization on
123+
user side ([#927](https://github.com/temporalio/sdk-typescript/pull/927))
124+
125+
- [`client`] `ConnectionOptions.connectTimeout` is now being applied correctly ([#954](https://github.com/temporalio/sdk-typescript/pull/954)).
126+
127+
- [`workflow`] Properly encode memos in `makeContinueAsNewFunc` ([#955](https://github.com/temporalio/sdk-typescript/pull/955)).
128+
They were previously not encoded at all, resulting in a failure due to invalid data.
129+
130+
- [`worker`] Activity metric `scheduled_to_start_latency` now reports the time from the schedule time of the
131+
_current attempt_ to the start time of that same attempt, instead of the time elapsed since the initial schedule time
132+
([#975](https://github.com/temporalio/sdk-typescript/pull/975)). This new definition aligns with other SDKs and is
133+
more useful from a monitoring perspective.
134+
135+
- [`workflow`] Previously, `condition(fn, 0)` was incorrectly handled the same as `condition(fn)`, meaning that the
136+
function would block indefinitely and would return nothing once `fn` evaluated to true. It now behaves the same as
137+
`condition(fn, 1)`, ie. the function will sleep for a very short time, then return true if `fn` evaluates to true,
138+
or false if timeout reaches its expiration ([#985](https://github.com/temporalio/sdk-typescript/pull/985)).
139+
140+
- [`core`] Fixed some non-deterministic behaviour in workflows containing local activities, due to heartbeats
141+
being incorrectly counted as logical workflow tasks ([#987](https://github.com/temporalio/sdk-typescript/pull/987)).
142+
143+
- [`core`] `core-bridge` has been refactored so that it does not retain static references to custom TypeScript error
144+
constructors ([#983](https://github.com/temporalio/sdk-typescript/pull/983)). This change is part of an ongoing effort
145+
to resolve multiple issues observed by some users in execution of their unit tests based on sdk-typescript, notably in
146+
conjunction with Jest, Mocha and Vitest.
147+
148+
- [`worker`] The default log function now write errors using `process.stderr.write` rather than `console.error`
149+
([#940](https://github.com/temporalio/sdk-typescript/pull/940)). This avoids complains by some test runners.
150+
151+
- [`debugger`] Log errors comming from VS Code debugger ([#968](https://github.com/temporalio/sdk-typescript/pull/968))
152+
153+
- Bug Fixes in Core SDK:
154+
- Fixed a situation causing Core to send activations containing both a legacy query and other jobs ([#427](https://github.com/temporalio/sdk-core/pull/427))
155+
- Don't use a process-wide unique id for sticky queues ([#430](https://github.com/temporalio/sdk-core/pull/430))
156+
- Added support for ignorable history events ([#422](https://github.com/temporalio/sdk-core/pull/422))
157+
- Avoid hang in duplicated run-ids during replay ([#417](https://github.com/temporalio/sdk-core/pull/417))
158+
- Backoff more if we receive ResourceExhausted error ([#408](https://github.com/temporalio/sdk-core/pull/408))
159+
160+
### Miscellaneous Tasks
161+
162+
- Improved code linting ([#771](https://github.com/temporalio/sdk-typescript/pull/771), thanks to [`@JounQin`](https://github.com/JounQin) 🙏)
163+
- [`client`] Extract a BaseClient super class ([#957](https://github.com/temporalio/sdk-typescript/pull/957))
164+
7165
## [1.4.4] - 2022-11-03
8166

9167
### Bug Fixes

0 commit comments

Comments
 (0)