[PR #93] [MERGED] Added "should handle checkpoints correctly" Unit Tests + Fix 2 Bugs That Were Preventing Them From Passing #482

Closed
opened 2026-02-15 18:17:09 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/93
Author: @janvi-codaio
Created: 3/21/2024
Status: Merged
Merged: 3/21/2024
Merged by: @nfcampos

Base: mainHead: janvi-pregel-test


📝 Commits (5)

📊 Changes

3 files changed (+15 additions, -14 deletions)

View changed files

📝 langgraph/src/channels/base.ts (+9 -11)
📝 langgraph/src/channels/binop.ts (+5 -2)
📝 langgraph/src/tests/pregel.test.ts (+1 -1)

📄 Description

The should handle checkpoints correctly unit test was initially skipped because it didn't pass.
This PR fixes the two bugs that were preventing it from passing.

  1. BinaryOperatorAggregate Channel did not implement empty() (aka - snapshot) correctly. The issue was that the old checkpoint's value was not being saved as the initial value leading to a lossy channel that stored state in correctly

  2. Checkpoint was not implemented correctly, because it would only update the checkpoint's channel value if it had never been set before. Updated the code such that it always update's the checkpoint value based on the latest channel value

Now that these have been fixed, add the checkpointing test back in!


🔄 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/93 **Author:** [@janvi-codaio](https://github.com/janvi-codaio) **Created:** 3/21/2024 **Status:** ✅ Merged **Merged:** 3/21/2024 **Merged by:** [@nfcampos](https://github.com/nfcampos) **Base:** `main` ← **Head:** `janvi-pregel-test` --- ### 📝 Commits (5) - [`211b23c`](https://github.com/langchain-ai/langgraphjs/commit/211b23cdeb15615f09969ab6759182090eb1b95a) added test back in and fixed two bugs - [`2020144`](https://github.com/langchain-ai/langgraphjs/commit/2020144b4529bd302a61116787d09c8e34314532) ran formatter - [`d277477`](https://github.com/langchain-ai/langgraphjs/commit/d2774772f7722b88fee84d35e7f90b8b08ac0a14) update - [`e9ede3b`](https://github.com/langchain-ai/langgraphjs/commit/e9ede3b9f7a7d4eb6a64fd222d83eb9b77cc386b) update - [`1d8cf14`](https://github.com/langchain-ai/langgraphjs/commit/1d8cf143e9a2522e26b196186a2a1055495168fc) update ### 📊 Changes **3 files changed** (+15 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `langgraph/src/channels/base.ts` (+9 -11) 📝 `langgraph/src/channels/binop.ts` (+5 -2) 📝 `langgraph/src/tests/pregel.test.ts` (+1 -1) </details> ### 📄 Description The `should handle checkpoints correctly` unit test was initially skipped because it didn't pass. This PR fixes the two bugs that were preventing it from passing. 1. `BinaryOperatorAggregate` Channel did not implement `empty()` (aka - snapshot) correctly. The issue was that the old checkpoint's value was not being saved as the initial value leading to a lossy channel that stored state in correctly 2. `Checkpoint` was not implemented correctly, because it would only update the checkpoint's channel value if it had never been set before. Updated the code such that it _always_ update's the checkpoint value based on the latest channel value Now that these have been fixed, add the checkpointing test back in! --- <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 18:17:09 -05:00
yindo closed this issue 2026-02-15 18:17:09 -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#482