Skip to content

SyncFileSystem does not throw when accessing a removed file that has been accessed in an effect/memo/resource #794

Open
@bigmistqke

Description

@bigmistqke

Describe the bug

Given the following testing setup:

const fs = createSyncFileSystem(makeVirtualFileSystem());
fs.writeFile("index.html", "hallo");
fs.writeFile("index2.html", "hallo");

createEffect(() => fs.readFile("index.html"));

test("index.html");
test("index2.html");

function test(path: string){
  try {
    fs.rm(path)
    const result = fs.readFile(path);
    console.error(`FAILURE ${path}: Expected throw but received "${result}"`);
  } catch (error) {
    console.log(`SUCCESS ${path}`);
  }
}

Currently

  • the test for index.html will fail, because it received "hallo" from fs.readFile
  • the test for index2.html will succeed, because fs.readFile threw

Reading the file in an effect seems to cause the file to not be cleaned up when being removed.

Minimal Reproduction Link

https://playground.solidjs.com/anonymous/a4c5374f-9432-4ec1-bf37-e65888e54a8f

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions