Skip to content

AsyncMirror and Dropbox fails when there are subfolders with file #276

@FredrikAleksander

Description

@FredrikAleksander

When using AsyncMirror and Dropbox, and there are subfolders with files, it fails during configure. In the error, it seems to try and fetch but uses the subfolder path twice errmsg
.

I'm running the latest code from the master branch

A simple way to reproduce this error is by using this code in a web page, waiting for it to write the changes, and reload the page.

var dbx = new Dropbox.Dropbox({ fetch, accessToken: 'REDACTED' });
BrowserFS.configure({
    fs: "AsyncMirror",
    options: {
        sync: { fs: "InMemory" },
        async: {
            fs: "Dropbox",
            options: {
                client: dbx
            }
        }
    }
}, function (err) {
    if (err) { console.log(err); return; }

    var fs = BrowserFS.BFSRequire('fs');
    if(!fs.existsSync('/subfolder')) {
    	fs.mkdirSync('/subfolder');
    	fs.writeFileSync('/subfolder/somefile.txt', 'hello world');
    }
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions