p4535992 / conditional-visibility

a FoundryVTT module to hide tokens from some players, but not from others
MIT License
5 stars 8 forks source link

[BUG] Removing invisible from a hostile token causes errors on client side and doesn't make them visible #12

Closed Zamrod closed 2 years ago

Zamrod commented 2 years ago

Module Version: v0.4.23

Describe the bug When you remove the invisible condition from a hostile token while a player is logged in and can see it, you get the following errors on the client side:

Uncaught (in promise) Error: User Player2 lacks permission to update Token [dTG1mANSz5rwUJ0E] in parent Scene [80a6xSJzcUX5jG8R]
[No packages detected]
    at ServerDatabaseBackend._updateEmbeddedDocuments (/C:/Program%20Files/FoundryVTT/Foundry%20Virtual%20Tabletop/resources/app/dist/database/backend/server-backend.mjs:1:3611)
    at async Semaphore._try (/C:/Program%20Files/FoundryVTT/Foundry%20Virtual%20Tabletop/resources/app/common/utils/semaphore.mjs:99:17)
lib.js:471 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'changes')
[Detected 1 package: conditional-visibility]
    at prepareActiveEffectForConditionalVisibility (lib.js:471:102)

The invisible token stays invisible until you deselect the player's token and select it again.

Browser: Chrome

Foundry Version: v9.255

Game System: DnD5e 1.5.7

p4535992 commented 2 years ago

try out 0.4.28 the lacks permission to update Token should be solve, working on the second one

p4535992 commented 2 years ago

I tried to fix the problem of passive perception in version 0.4.29, if you still see some problems enable the setitings debug module and pass me the logs. I tried to update the documentation https://github.com/p4535992/conditional-visibility/blob/master/wiki/tutorial.md, try to tell me if it comes back to you.

Zamrod commented 2 years ago

This problem has gotten worse. Instead of a couple of messages, players now get continual messages about not being able to update every token on the scene:

image

This is in 0.5.21

The error in the console is now:

foundry.js:2253 Uncaught (in promise) Error: User Player2 lacks permission to update Token [TwbUCEU6vAmvKKBN] in parent Scene [80a6xSJzcUX5jG8R]
[No packages detected]
    at ServerDatabaseBackend._updateEmbeddedDocuments (/C:/Program%20Files/FoundryVTT/Foundry%20Virtual%20Tabletop/resources/app/dist/database/backend/server-backend.mjs:1:3611)
    at async Semaphore._try (/C:/Program%20Files/FoundryVTT/Foundry%20Virtual%20Tabletop/resources/app/common/utils/semaphore.mjs:99:17)
p4535992 commented 2 years ago

@zamrod i cannot see these messages on my test world , i put some more if else control, try out 0.5.23 and let me know it.

Zamrod commented 2 years ago

Nope. Still the same: image

p4535992 commented 2 years ago

on version 0.5.25 i stopped the loop, the error still persist , but i don't know why...

Zamrod commented 2 years ago

So it still causes those errors in my test world but I created a new test world and the errors don’t happen there.

p4535992 commented 2 years ago

@Zamrod I'm so stupid, sorry for the inconvenience, if god wants I solved it with 0.5.26, but I keep making mistakes a lot. Let me know it.

Zamrod commented 2 years ago

This works now. No errors on any world

p4535992 commented 2 years ago

Feel free to reopen the issue if you keep rediscovering it