[PR #577] [CLOSED] fix(checkpoint-postgres): store channel_values correctly #863

Closed
opened 2026-02-15 19:16:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/577
Author: @benjamincburns
Created: 10/10/2024
Status: Closed

Base: mainHead: fix-postgressaver-channel_values


📝 Commits (1)

  • f2818bb fix(checkpoint-postgres): store channel_values correctly

📊 Changes

2 files changed (+7 additions, -8 deletions)

View changed files

📝 libs/checkpoint-postgres/src/index.ts (+5 -4)
📝 libs/checkpoint-postgres/src/tests/checkpoints.int.test.ts (+2 -4)

📄 Description

Prior to this change, PostgresSaver wouldn't store channel_values if newVersions wasn't passed to the put method. This is due to a filter check in _dumpBlobs that checks each channel name to ensure it appears in the channel versions object prior to serializing it for storage.

Upon inspecting the other CheckpointSaver types, I noticed that MemorySaver, MongoDBSaver, and SqliteSaver) all ignore the newVersions argument to the BaseCheckpointSaver.put method, so I think this is the correct fix. From what I can see by searching references, no test code (apart from the tests this PR changes) passes the newVersions argument.

That said, the one reference to BaseCheckpointSaver.put that I found in actual shipped code is in PregelLoop._putCheckpoint (via _checkpointerPutAfterPrevious), and this does pass the newVersions argument.

So I have to ask, are all of the other CheckpointSaver implementations, and all of the existing tests implemented incorrectly, or is this the correct fix?

Found this while working on #541, thanks to the getTuple tests (all of them failed when I wired them up to PostgresSaver).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/577 **Author:** [@benjamincburns](https://github.com/benjamincburns) **Created:** 10/10/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-postgressaver-channel_values` --- ### 📝 Commits (1) - [`f2818bb`](https://github.com/langchain-ai/langgraphjs/commit/f2818bb48b1dfbebe50c809ef1aea950293dbf90) fix(checkpoint-postgres): store channel_values correctly ### 📊 Changes **2 files changed** (+7 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `libs/checkpoint-postgres/src/index.ts` (+5 -4) 📝 `libs/checkpoint-postgres/src/tests/checkpoints.int.test.ts` (+2 -4) </details> ### 📄 Description Prior to this change, `PostgresSaver` wouldn't store `channel_values` if `newVersions` wasn't passed to the `put` method. This is due to a [filter check in `_dumpBlobs`](https://github.com/langchain-ai/langgraphjs/blob/45e59e64175a89a7cf782015b011b7d348ef835f/libs/checkpoint-postgres/src/index.ts#L186) that checks each channel name to ensure it appears in the channel versions object prior to serializing it for storage. Upon inspecting the other `CheckpointSaver` types, I noticed that [`MemorySaver`](https://github.com/langchain-ai/langgraphjs/blob/45e59e64175a89a7cf782015b011b7d348ef835f/libs/checkpoint/src/memory.ts#L270-L274), [`MongoDBSaver`](https://github.com/langchain-ai/langgraphjs/blob/45e59e64175a89a7cf782015b011b7d348ef835f/libs/checkpoint-mongodb/src/index.ts#L204-L208), and [`SqliteSaver`](https://github.com/langchain-ai/langgraphjs/blob/45e59e64175a89a7cf782015b011b7d348ef835f/libs/checkpoint-sqlite/src/index.ts#L217-L221)) all ignore [the `newVersions` argument to the `BaseCheckpointSaver.put` method](https://github.com/langchain-ai/langgraphjs/blob/45e59e64175a89a7cf782015b011b7d348ef835f/libs/checkpoint/src/base.ts#L148), so I _think_ this is the correct fix. From what I can see by searching references, no test code (apart from the tests this PR changes) passes the `newVersions` argument. That said, the **one** reference to `BaseCheckpointSaver.put` that I found in actual shipped code is in [`PregelLoop._putCheckpoint`](https://github.com/langchain-ai/langgraphjs/blob/45e59e64175a89a7cf782015b011b7d348ef835f/libs/langgraph/src/pregel/loop.ts#L780-L785) (via [`_checkpointerPutAfterPrevious`](https://github.com/langchain-ai/langgraphjs/blob/45e59e64175a89a7cf782015b011b7d348ef835f/libs/langgraph/src/pregel/loop.ts#L368)), and this _does_ pass the `newVersions` argument. So I have to ask, **are all of the other `CheckpointSaver` implementations, and all of the existing tests implemented incorrectly, or is this the correct fix?** Found this while working on #541, thanks to [the `getTuple` tests](https://github.com/benjamincburns/langgraphjs/blob/d95f4aafac23d2f39c12a7c1c0a2f2ede0815ba8/libs/checkpoint-validation/src/tests/spec/getTuple.ts) (all of them failed when I [wired them up to `PostgresSaver`](https://github.com/benjamincburns/langgraphjs/blob/d95f4aafac23d2f39c12a7c1c0a2f2ede0815ba8/libs/checkpoint-validation/src/tests/postgres.spec.ts#L64)). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 19:16:11 -05:00
yindo closed this issue 2026-02-15 19:16:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#863