@langchain/langgraph-sdk 0.0.92 → 0.0.93

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @langchain/langgraph-sdk
2
2
 
3
+ ## 0.0.93
4
+
5
+ ### Patch Changes
6
+
7
+ - d53c891: Fix useStream race condition when flushing messages
8
+
3
9
  ## 0.0.92
4
10
 
5
11
  ### Patch Changes
@@ -329,6 +329,7 @@ function useStream(options) {
329
329
  clearCallbackRef.current = () => {
330
330
  setStreamError(undefined);
331
331
  setStreamValues(null);
332
+ messageManagerRef.current.clear();
332
333
  };
333
334
  const historyLimit = typeof fetchStateHistory === "object" && fetchStateHistory != null
334
335
  ? fetchStateHistory.limit ?? true
@@ -476,8 +477,6 @@ function useStream(options) {
476
477
  }
477
478
  finally {
478
479
  setIsLoading(false);
479
- // Assumption: messages are already handled, we can clear the manager
480
- messageManagerRef.current.clear();
481
480
  submittingRef.current = false;
482
481
  abortRef.current = null;
483
482
  }
@@ -325,6 +325,7 @@ export function useStream(options) {
325
325
  clearCallbackRef.current = () => {
326
326
  setStreamError(undefined);
327
327
  setStreamValues(null);
328
+ messageManagerRef.current.clear();
328
329
  };
329
330
  const historyLimit = typeof fetchStateHistory === "object" && fetchStateHistory != null
330
331
  ? fetchStateHistory.limit ?? true
@@ -472,8 +473,6 @@ export function useStream(options) {
472
473
  }
473
474
  finally {
474
475
  setIsLoading(false);
475
- // Assumption: messages are already handled, we can clear the manager
476
- messageManagerRef.current.clear();
477
476
  submittingRef.current = false;
478
477
  abortRef.current = null;
479
478
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-sdk",
3
- "version": "0.0.92",
3
+ "version": "0.0.93",
4
4
  "description": "Client library for interacting with the LangGraph API",
5
5
  "type": "module",
6
6
  "scripts": {