Larkinabout / fvtt-token-action-hud-core

Token Action HUD is a repositionable HUD of actions for a selected token.
14 stars 17 forks source link

[BUG] HUD stops working if "modules/token-action-hud-core/storage" folder is set to private #199

Closed morepurplemorebetter closed 10 months ago

morepurplemorebetter commented 10 months ago

Describe the bug This happens after updating from v1.4.18 to v1.4.19 If the modules/token-action-hud-core/storage folder is private (or any of its parents), players won't get a HUD. Also, if the storage subfolders are ever deleted, the module fails to initialise. Learned this when trying to move back to an older version.

Steps to reproduce

  1. Set the modules/token-action-hud-core/storage folder to private (or any of its parent folders).
  2. Load the world from an account other than the GM.
  3. See the following error message in the console: Uncaught (in promise) Error: Directory modules/token-action-hud-core/storage/toa/actor/ does not exist or is not accessible in this storage location
  4. See that no HUD will load for the player.

If the storage folder is empty (i.e. no worlds sub-folder), the DM will also not get any HUD.

The reason for the error is that FilePicker.browse doesn't work for a player on a folder that is set to private.

Versions:

Additional context This can be fixed by not setting the folder to private, but that is a pain as I'd like to have all other module folders set to private.

If someone was to delete the storage subfolders, to clear all the customisations for example, it would be great if the module would just recreate them instead of throwing an error.

I have this issue also with the Build-a-Bonus module, see this issue. Perhaps you can see how to fix it if it gets fixed there.

Larkinabout commented 10 months ago

The best I can do is check if the directory is private by catching it fail and execute as the GM instead. If you do want to avoid executing as the GM, you'll need to leave the directory as not private as you've done.

fatigues65 commented 10 months ago

To be clear, I had the exact same issue last night in a PF2 game, v 11 308, PF2 5.5.2.

Something new has happened within TAH to cause this behavior as everything was working until I updated over the weekend to .308, 5.5.2 and updated all mods (including TAH Core and PF2).

Larkinabout commented 10 months ago

I suspect the "something new" is that I tidied up the data handler and it's now doing as was intended and using the player permissions where they have browse and upload permissions. Regardless, I've handled for private directories in the next release.

Larkinabout commented 10 months ago

Fixed in Token Action HUD Core 1.4.20.