Skip to content

Conversation

@sinedied
Copy link
Contributor

Fixes a small possible race condition on FileSystemChatMessageHistory, and removes unneeded extra check

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

🦋 Changeset detected

Latest commit: 411df8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/community Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added community Issues related to `@langchain/community` pkg:@langchain/community labels Nov 18, 2025
@christian-bromann
Copy link
Member

Fixes a small possible race condition on FileSystemChatMessageHistory, and removes unneeded extra check

I can see the removes unneeded extra check part but not the fix of a race condition 🤔

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the PR is not complete?

@sinedied
Copy link
Contributor Author

@christian-bromann It's surprising but complete :) I started initially by refactoring the code to use file descriptors, but it turned out that the first fs.access() check that causes the race condition wasn't even needed in the first place, so the fix was even simpler 😅

@sinedied
Copy link
Contributor Author

sinedied commented Dec 4, 2025

Bumping this, @christian-bromann / @hntrl could you review this one? Just confirming that removing this single line is the fix 🙂

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Good catch!

@christian-bromann christian-bromann merged commit ca32dd7 into langchain-ai:main Dec 5, 2025
31 checks passed
@github-actions github-actions bot mentioned this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Issues related to `@langchain/community` pkg:@langchain/community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants