Not all links generate
Sigafoos opened this issue · 1 comments
In my test world, somefin else
should have a link from refrance
but doesn't.
I’ve made a few improvements locally but am still having the issue. It looks like only one entity’s links are saved.
It’s correct in the local game
object, for all users, but it’s not persisted to the .db file. This means a “fix” is to wait for everyone to be connected to the server and sync every time you play. This is a bad fix.
Improvements I’ve made that don’t seem to have any effect (but which we’re still important to make)
- await all calls to
setFlag
to avoid race conditions - call
game[entityType].get(id).setFlag(...)
instead of on the local entity in case it’s acting on a locally cached object rather than the reference (I don’t think this was an issue, but now it’s definitely not) - duplicate the array of ids when setting, as Foundry compares by reference and was saying “oh this is the same object, I won’t save”
The last one seems to be what the issue is, as it explains why it’s fine in the game
object but not in the database. It still wasn’t working, but I have a few different ways to approach it (I’ve just been busy the past few days)