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

client.remove() produces non-existing node errors #1255

Open
bdashore3 opened this issue Dec 3, 2021 · 2 comments
Open

client.remove() produces non-existing node errors #1255

bdashore3 opened this issue Dec 3, 2021 · 2 comments
Labels

Comments

@bdashore3
Copy link

bdashore3 commented Dec 3, 2021

Environment:

  • nodejs 14.x
  • typescript 4.x

Hi there,
I'm currently working with managing files in remoteStorage where adding and reading files works fine. However, using the remove function produces this error and doesn't delete the file:

Cannot delete non-existing node /test-project/index.html
Cannot delete non-existing node /test-project/
Cannot delete non-existing node /

Code:

const remoteStorage = new RemoteStorage();
remoteStorage.access.claim('*', 'rw');

remoteStorage.connect('user@5apps.com', 'token');

remoteStorage.on('ready', () => {
    console.log('remotestorage is ready');
});
remoteStorage.on('connected', () => {
    const userAddress = remoteStorage.remote.userAddress;
    console.debug(`${userAddress} connected their remote storage.`);
    const client = remoteStorage.scope('/test-project/');

    client
        .remove('index.html')
        .then((x) => console.log(x))
        .catch((err) => console.log(err));
});
@raucao
Copy link
Member

raucao commented Dec 3, 2021

Before investigating this, just a note:

This could be an edge case with the default caching strategy (caching is enabled with the SEEN strategy by default) and node.js usage, which uses in-memory caching and where the cache is lost between restarts.

See https://remotestoragejs.readthedocs.io/en/latest/js-api/caching.html for details about caching.

However, it is still a bug, of course, because it should fetch metadata of the remote document again in this case, and delete it upon seeing it's there, before claiming that the document does not exist at all.

@raucao raucao added the bug label Dec 3, 2021
@raucao
Copy link
Member

raucao commented Jan 17, 2023

@bdashore3 Is this still a problem for you? If so, could you provide a more complete version of the failing code, so we can reproduce the error?

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

No branches or pull requests

2 participants