narraeon 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,7 +98,8 @@ export async function createServer(input) {
98
98
  runtimeRequestType === "play.chain.append") &&
99
99
  isRecord(response.result) &&
100
100
  response.result.status === "interrupted" &&
101
- typeof response.result.lastFailure === "string")
101
+ typeof response.result.lastFailure === "string" &&
102
+ !hasPlayCancellation(response.result))
102
103
  request.log.error({
103
104
  runtimeRequestType,
104
105
  playCallFailure: response.result.lastFailure,
@@ -162,7 +163,8 @@ function sendPlayCallChainStream(runtime, runtimeRequest, request, reply) {
162
163
  throw new Error("The Runtime stream did not return a call-chain snapshot");
163
164
  send({ kind: "snapshot", value: response.result, final: true });
164
165
  if (response.result.status === "interrupted" &&
165
- response.result.lastFailure !== null)
166
+ response.result.lastFailure !== null &&
167
+ !hasPlayCancellation(response.result))
166
168
  request.log.error({
167
169
  runtimeRequestType: runtimeRequest.type,
168
170
  playCallFailure: response.result.lastFailure,
@@ -189,3 +191,9 @@ function isPlayCallChainView(value) {
189
191
  value.status === "running" ||
190
192
  value.status === "interrupted"));
191
193
  }
194
+ function hasPlayCancellation(value) {
195
+ if (!isRecord(value) || !Array.isArray(value.events))
196
+ return false;
197
+ const last = value.events.at(-1);
198
+ return isRecord(last) && last.kind === "cancellation";
199
+ }