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

Improve the logic and function used to compute package persisted directory size and resolve a bug which could occur if the persistent storage location does not exist. #9274

Closed
2 of 6 tasks
TheGiddyLimit opened this issue Apr 24, 2023 · 0 comments
Assignees
Labels
bug Functionality which is not working as intended packages Issues related to add-on packages, systems, modules, and worlds

Comments

@TheGiddyLimit
Copy link

TheGiddyLimit commented Apr 24, 2023

What happened?

For a module with "persistentStorage": true set in its manifest (#8590), removing the storage directory, after installation, for that module bricks the /setup screen (and likely others).

It would be ideal if the missing storage dir was either ignored or re-created when required.

What ways of accessing Foundry can you encounter this issue in?

  • Native App (Electron)
  • Chrome
  • Firefox
  • Safari
  • Other

Reproduction Steps

  1. From Foundry's /setup screen, Install a module with "persistentStorage": true (here's one I prepared earlier: https://github.com/TheGiddyLimit/foundry-module-stub/releases/tag/v1.0.0 )
  2. Shut down the Foundry server
  3. Delete <dataDir>/Data/modules/<moduleId>/storage
  4. Restart the server, reload /setup

Expected: the page to load and display without issue

Actual:

FoundryVTT | 2023-04-24 20:39:57 | [error] ENOENT: no such file or directory, scandir 'C:\repos\0-test-foundry-11\data\Data\modules\a-module-stub/storage'
Error: ENOENT: no such file or directory, scandir 'C:\repos\0-test-foundry-11\data\Data\modules\a-module-stub/storage'
    at Object.readdirSync (node:fs:1438:3)
    at t (file:///C:/repos/foundry/foundryvtt-11.295/resources/app/dist/files/files.mjs:1:1489)
    at Files.getDirectorySize (file:///C:/repos/foundry/foundryvtt-11.295/resources/app/dist/files/files.mjs:1:1623)
    at Module.vend (file:///C:/repos/foundry/foundryvtt-11.295/resources/app/dist/packages/package.mjs:1:4611)
    at file:///C:/repos/foundry/foundryvtt-11.295/resources/app/dist/server/views/setup.mjs:1:3150
    at Collection.map (file:///C:/repos/foundry/foundryvtt-11.295/resources/app/common/utils/collection.mjs:162:24)
    at SetupView.handleSocket (file:///C:/repos/foundry/foundryvtt-11.295/resources/app/dist/server/views/setup.mjs:1:3140)
    at Socket.<anonymous> (file:///C:/repos/foundry/foundryvtt-11.295/resources/app/dist/server/sockets.mjs:1:1357)
    at Socket.emit (node:events:512:28)
    at Socket.emitUntyped (C:\repos\foundry\foundryvtt-11.295\resources\app\node_modules\socket.io\dist\typed-events.js:69:22)

What core version are you reporting this for?

Version 11 Build 295

Relevant log output

No response

Bug Checklist

  • The issue occurs while all Modules are disabled
@TheGiddyLimit TheGiddyLimit added the bug Functionality which is not working as intended label Apr 24, 2023
@Fyorl Fyorl added the packages Issues related to add-on packages, systems, modules, and worlds label Apr 24, 2023
@Fyorl Fyorl added this to the Version 11 - Testing 1 milestone Apr 24, 2023
@aaclayton aaclayton self-assigned this Apr 26, 2023
@aaclayton aaclayton changed the title Crash on missing module "storage" directory for existing module Improve the logic and function used to compute package persisted directory size and resolve a bug which could occur if the persistent storage location does not exist. Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended packages Issues related to add-on packages, systems, modules, and worlds
Projects
Status: Done
Development

No branches or pull requests

3 participants