Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Issue #455: StorageContext not saving data after deleting document/ref info #486

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

1997roylee
Copy link

@1997roylee 1997roylee commented Jan 30, 2024

Issue #455: StorageContext not saving data after deleting document/ref info

Changes Proposed:
Change the BaseInMemoryKVStore to SimpleKVStore for SimpleDocumentStore.

Original code:

this.kvStore instanceof BaseInMemoryKVStore

Now:

this.kvStore instanceof SimpleKVStore

Copy link

changeset-bot bot commented Jan 30, 2024

⚠️ No Changeset found

Latest commit: 907385e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Jan 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
llama-index-ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2024 6:12am

@@ -55,6 +55,11 @@ export class SimpleKVStore extends BaseKVStore {
): Promise<boolean> {
if (key in this.data[collection]) {
delete this.data[collection][key];

if (this.persistPath) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@1997roylee thanks for looking into #455!
but persisting the whole store can take a long time, so doing it for every change operation seems not to be feasible. That's why we're having the explicit persist method.
We're working on a fix for #455.

Copy link
Author

Choose a reason for hiding this comment

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

It makes sense, but why is the 'persist' method checking if the instance is equal to 'BaseInMemoryKVStore'? I don't see any involvement of 'SimpleDocumentStore' with 'BaseInMemoryKVStore'.

I proposed to change the BaseInMemoryKVStore to SimpleKVStore.

Original code:

this.kvStore instanceof BaseInMemoryKVStore

Now:

this.kvStore instanceof SimpleKVStore

Copy link
Collaborator

Choose a reason for hiding this comment

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

@1997roylee good catch, i think we don't need this instanceof check at all - @himself65 can you have a look into this while working on #487 ?

Copy link
Member

Choose a reason for hiding this comment

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

yes I think instanceof is useless here. But it okay for now

Copy link
Author

Choose a reason for hiding this comment

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

should I close this PR? Or I can help to fix the persist issue of another class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants