You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug Description:
The bug involves two somewhat related issues:
When running data migration for characters made in 0.1.1 the Fabula Points from the system.fp always overwrite the fabula points stored in system.resources.fp
Solving this is a bit tricky since 0.1.1 seems to have a bug where the data template specifies system.resources.fp however the system itself incorrectly? uses system.fp.
When running data migration for characters made in 0.1.1 the Bond migration will append extra entries.
This one is pretty easy to see in the code -- Looking at migrateLegacyBonds you can see pretty clearly that bondN properties get pushed onto the bonds array, so when the bonds array gets saved into the DB, the next time the data migration step gets run (e.g. on page refresh) all those bondN properties will be pushed onto the now populated bonds list.
Steps to Reproduce:
Load the attached world.
Note: The Gamemaster password for this world is just blank.
Change FP for the aaaaa actor to a number other than a 3 then press tab to make sure the value gets persisted to the db.
Due to some other bug here if you attempt to change the number to a 3 then the value will immediately revert back to a 5. Changing to a non-3 number just once will fix whatever issue it is (presumably some uninitialized value?)
Refresh the page.
After refresh open the aaaaa actor and you should see that the FP has been reset to 5.
Open the bbbbb actor.
Click the "+" to add a new bond. It doesn't matter if you populate the bond field or not.
Refresh the page.
After refresh open the bbbbb actor and you will now see the previous bonds duplicated below the new row you added in (6)
Expected behavior:
Expected FP Behavior: FP should remain to whatever you changed them to in (2).
Expected Bonds Behavior: Bonds should not duplicate themselves.
I'm sad to say this is a larger problem than it appears, probably requiring some sort of dedicated mechanism to migrate the database.
Thankfully it appears that there is simple workaround for these problems: Duplicating the affected Actors
A bit more details:
The problem is caused by outdated source data being stored in the server database.
The DataModel::migrateData API allows us to "fix" old data clientside, but it lacks a way to push these fixes to the database.
So each time we "fix" the data clientside, we are actually overwriting legit data.
This is caused by FoundryVTT using differential updates, which means that deletions have to be pushed to the database explicitly and will not get picked up automatically.
By duplicating, a snapshot of the clientside data is used to create the duplicate, which does not contain the problematic fields (because we removed them during migration).
Foundry should add frameworks to support both client- and serverside migrations in V12.
With this in mind and a simple workaround present, I feel this is not worth the time and effort of implementation at this time.
Bug Description:
The bug involves two somewhat related issues:
system.fp
always overwrite the fabula points stored insystem.resources.fp
system.resources.fp
however the system itself incorrectly? usessystem.fp
.migrateLegacyBonds
you can see pretty clearly thatbondN
properties get pushed onto the bonds array, so when the bonds array gets saved into the DB, the next time the data migration step gets run (e.g. on page refresh) all thosebondN
properties will be pushed onto the now populatedbonds
list.Steps to Reproduce:
aaaaa
actor to a number other than a 3 then presstab
to make sure the value gets persisted to the db.aaaaa
actor and you should see that the FP has been reset to 5.bbbbb
actor.bbbbb
actor and you will now see the previous bonds duplicated below the new row you added in (6)Expected behavior:
Expected FP Behavior: FP should remain to whatever you changed them to in (2).
Expected Bonds Behavior: Bonds should not duplicate themselves.
Attachments (if applicable):
aaa.tar.gz
The text was updated successfully, but these errors were encountered: