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

[BUG] - [DND5e] - macroData is reformatted twice in some cases causing an exception #681

Open
5 tasks done
matthewbstroud opened this issue Nov 4, 2024 · 1 comment
Open
5 tasks done
Labels
bug Something isn't working

Comments

@matthewbstroud
Copy link

matthewbstroud commented Nov 4, 2024

I confirm the following:

  • I am on the latest version of Item Piles
  • I have tried to clear my cache (Ctrl / Cmd + F5)
  • I have checked the console for errors (F12 to open, Console tab)
  • I have tried to reset Item Piles' system settings
  • I have reproduced this bug with only item piles & its dependency modules enabled

Describe the bug
Private API method _transferItems calls _executeMacro for the source and target. If both piles have a macro you will get an exception on fromUuidSync. This is because both calls will attempt to resolve source and target uuids to the corresponding object.

On the second call the uuids are already objects.
image
This is the line you will get the failure on, because we are passing a document instead of a uuid.
image

To Reproduce
Steps to reproduce the behavior:

  1. Create an item pile with a defined macro.
  2. Create a second item pile with a defined macro.
  3. use the API to transfer an item from pile1 to pile2
  4. See error

Expected behavior
The macro data should only be reformatted once.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup

  • Foundry Version: [12.330]
  • System Version: [DND5e 3.3.1]
  • Item Piles Version: [e.g. 3.1.6]
  • Browser & version [Edge 130.0.2849.68]

Active modules

  • Item Piles
  • libwrapper
  • socketlib

Additional context
Add any other context about the problem here.

@matthewbstroud
Copy link
Author

This is a proposed fix.
#682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant