-
Notifications
You must be signed in to change notification settings - Fork 79
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
V10 world migration #1089
V10 world migration #1089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Couple things below
modules/swffg-main.js
Outdated
let item_id = item._id; | ||
delete item_migrated._id; | ||
// persist the changes to the DB | ||
actor.items.filter(i => i._id === item_id)[0].update(item_migrated); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not just call item.update(item_migrated)
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, it complains that you're trying to modify the ID (even though they match), and the ID is a read-only field, so you can't even delete it
edit: oop it's RO somewhere else but the first half is still true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that using the item_migrated object as the param though, after you delete _id from it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, no, it's simply item.update(item)
. I'll try your suggestion - misunderstood the first... two times :p
modules/swffg-main.js
Outdated
let item_id = item._id; | ||
delete item_migrated._id; | ||
// persist the changes to the DB | ||
game.items.filter(i => i._id === item_id)[0].update(item_migrated); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here item.update(item_migrated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also ditto here!
yup, that makes sense :p Co-authored-by: Matt Stoolman <Esrin@users.noreply.github.com>
Looks like we can't use structuredClone directly as it's only available globally when accessing Foundry through a browser, it breaks if using the electron app. Going to push a fix for that... we just use I'll throw a fix for that and a couple other little deprecations and bugs I noticed when testing a friend's Genesys world. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're in a much better state here for starwarsffg and genesys worlds.
fix known migration issues and a few non-migration issues because I forgot this was a migration branch :p