Skip to content
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

Not all links generate #7

Closed
Sigafoos opened this issue Sep 3, 2020 · 1 comment
Closed

Not all links generate #7

Sigafoos opened this issue Sep 3, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Sigafoos
Copy link
Owner

Sigafoos commented Sep 3, 2020

In my test world, somefin else should have a link from refrance but doesn't.

@Sigafoos
Copy link
Owner Author

Sigafoos commented Sep 7, 2020

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)

@Sigafoos Sigafoos added the bug Something isn't working label Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant