Skip to content

Commit

Permalink
Fix: migrations are again persistent
Browse files Browse the repository at this point in the history
There was a problem getting the updateData with `.toObject()` from the modified actor.
When modifying the actor inplace without calling `.update(...)` the actor source (the Document DataSource) is not updated, and `.toObject()` returns the old `actor.system`.
  • Loading branch information
Eryx5502 committed Feb 7, 2024
1 parent 90c94fe commit cd6339a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module/migration/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ async function migrateAllActors(migration) {

for (const actor of actors) {
console.log(`AnimaBF | Migrating actor ${actor.name} (${actor.id}).`);
const updateData = (await migration.updateActor(actor)).toObject();
await actor.update(updateData);
const system = (await migration.updateActor(actor)).system;
await actor.update({ system });
}

// Lock again packs which where locked
Expand Down

0 comments on commit cd6339a

Please sign in to comment.