Skip to content

Commit 8f01f68

Browse files
author
=
committed
typing+final+text activity returns undefined
1 parent 5f5fe92 commit 8f01f68

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

packages/core/src/utils/getActivityLivestreamingMetadata.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const activityExtras = {
3737
id: string()
3838
};
3939

40+
const { text: _text, ...activityExtrasFinal } = activityExtras;
41+
4042
const channelDataStreamingActivitySchema = union([
4143
// Interim.
4244
object({
@@ -87,14 +89,12 @@ const channelDataStreamingActivitySchema = union([
8789
streamType: literal('final')
8890
}),
8991
entities: optional(array(any()), EMPTY_ARRAY),
90-
...activityExtras
92+
text: optional(undefinedable(literal(''))),
93+
...activityExtrasFinal
9194
})
9295
]);
9396

94-
// Extra Activity
95-
9697
const entitiesStreamingActivitySchema = union([
97-
// Same thing but for entities
9898
object({
9999
type: literal('typing'),
100100
entities: array(
@@ -151,7 +151,8 @@ const entitiesStreamingActivitySchema = union([
151151
})
152152
),
153153
channelData: any(),
154-
...activityExtras
154+
text: optional(undefinedable(literal(''))),
155+
...activityExtrasFinal
155156
})
156157
]);
157158

0 commit comments

Comments
 (0)