Skip to content

Fix gulp/cleanPackData stripping _stats

Ryan Walder requested to merge ryanw/fix-packs-stats into hotfix-0.87.7

Intent

During building packs/exporting packs we were removing the _stats key from the data as we previously thought it was re-generated whenever an item was imported. Unfortunately this was not the case for unlinked tokens (Mooks/Containers etc.) which caused item validation to fail during Foundry's internal v11 migrations meaning unlinked tokens would lose those items/reset them.

This commit makes sure all compendia are updated with the _stats key and removes deleting the _stats key during cleanPackData replacing it with a function that simply changes the _stats.lastModifiedBy key to 00CPRCBuildBot00 which matches the way 5e does it.

As this is a hotfix MR the Commit/Changes tabs are not so helpful. Please use the below comparison the see the actual changes:

https://gitlab.com/cyberpunk-red-team/fvtt-cyberpunk-red-core/-/compare/v0.87.6...ryanw%2Ffix-packs-stats?from_project_id=22820629&straight=false


  • This is meant for a hotfix
  • This is meant for the next release (see milestone)
  • This needs more reviewers than normal; there may be controversy or high complexity
  • This intentionally introduces regressions that will be addressed later
  • There is/will be documentation changes on the wiki
  • Please do not send commits here without coordinating closely with the owner
  • This is a Build System change

Related Issues

  • N/A

Steps to Test

  1. Check the commits
    • All items now have _stats
  2. Using Foundry v10
  3. Checkout this branch / Build / Load
  4. Create a new world
  5. Create new Mook
  6. Drag Mook into a Scene
  7. Add items to Mook Token from Compendia
    • IMPORTANT! Must be the Token not the Actor
  8. Do the same with a Container
  9. Switch to Foundry v11
  10. Copy World you created above to your v11 environment
  11. Checkout master / Build / Load
  12. Load World
  13. Let any migrations happen
  14. Check Mook Token
    • Has not lost items
  15. Check Container items
    • Has not lost items

Future Work

Replicate the same functionality in master/v11/0.88. This will be done once this has been merged into master

Edited by Ryan Walder

Merge request reports