dev7355608 / perfect-vision

Foundry VTT Module: Lighting Drawings and Vision Limitation.
https://foundryvtt.com/packages/perfect-vision
MIT License
53 stars 10 forks source link

Custom Vision Rules Checkbox Cleared On Token Configuration Close #301

Closed Tarbarian closed 2 years ago

Tarbarian commented 2 years ago

Expected Behavior

When closing a token's configuration without updating (pressing the X Close button) the token settings should not be changed.

Current Behavior

When closing a token's configuration without updating (pressing the X Close button) the Custom Vision Rules gets "unchecked", but only for the current user. That is to say that the system acts as if that box was not checked for that client, but on a refresh the box returns to being checked until the configuration is closed again without updating. Reopening the configuration and pressing the Update Token button without rechecking the box makes the unchecking "permanent."

Steps to Reproduce

  1. Create a token with "Custom Vision Rules" checked.
  2. Open token configuration and close it without updating.

Context

No response

Version

4.0.32

Foundry VTT Version

v10.288

Operating System

Windows

Browser / App

Native App (Electron), Chrome

Game System

pf1e 0.82.2

Relevant Modules

No response

dev7355608 commented 2 years ago

I'm able to reproduce this without any modules enabled: Custom Vision Rules is not reset back to the original state if the config is closed without saving. It's a pf1e system bug.

Tarbarian commented 2 years ago

I am unable to reproduce the issue without modules. Gifs for proof. Recording 2022-10-22 at 12 14 36 Recording 2022-10-22 at 12 20 41

Had to butcher the second gif to get it under 10MB

dev7355608 commented 2 years ago

The bug I discovered (no modules):

  1. Open Token config.
  2. Toggle Custom Vision Rules.
  3. Close Token config (not Update Token).
  4. Reopen Token config.

Result: Custom Vision Rules isn't reset to the state it was when the Token config was opened; it's still in preview state.

I assume this system bug just takes another form if PV is enabled, but the underlying source of the problem is in the system.

Tarbarian commented 2 years ago

Ah, yeah, that is indeed a core bug and I could see how that would take a new form under PV. I'll bring this to the PF1e devs. Thanks!