Skip to content

Commit

Permalink
fix(checkpoint-mongodb): fix utf8 encoding support
Browse files Browse the repository at this point in the history
  • Loading branch information
mosluce committed Dec 3, 2024
1 parent 1d86b90 commit e8bd26b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/checkpoint-mongodb/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class MongoDBSaver extends BaseCheckpointSaver {
};
const checkpoint = (await this.serde.loadsTyped(
doc.type,
doc.checkpoint.value()
doc.checkpoint.value("utf8")
)) as Checkpoint;
const serializedWrites = await this.db
.collection(this.checkpointWritesCollectionName)
Expand All @@ -100,7 +100,7 @@ export class MongoDBSaver extends BaseCheckpointSaver {
serializedWrite.channel,
await this.serde.loadsTyped(
serializedWrite.type,
serializedWrite.value.value()
serializedWrite.value.value("utf8")
),
] as CheckpointPendingWrite;
})
Expand All @@ -111,7 +111,7 @@ export class MongoDBSaver extends BaseCheckpointSaver {
pendingWrites,
metadata: (await this.serde.loadsTyped(
doc.type,
doc.metadata.value()
doc.metadata.value("utf8")
)) as CheckpointMetadata,
parentConfig:
doc.parent_checkpoint_id != null
Expand Down Expand Up @@ -171,11 +171,11 @@ export class MongoDBSaver extends BaseCheckpointSaver {
for await (const doc of result) {
const checkpoint = (await this.serde.loadsTyped(
doc.type,
doc.checkpoint.value()
doc.checkpoint.value("utf8")
)) as Checkpoint;
const metadata = (await this.serde.loadsTyped(
doc.type,
doc.metadata.value()
doc.metadata.value("utf8")
)) as CheckpointMetadata;

yield {
Expand Down

0 comments on commit e8bd26b

Please sign in to comment.