CodaBool / terminal

A FoundryVTT module to create interactive terminals with custom content and theming
2 stars 0 forks source link

[BUG] - Terminal label duplication and buggy enabling behavior #7

Closed CodaBool closed 1 month ago

CodaBool commented 1 month ago

I haven't seen this issue reported on GitHub yet but I want to track this down. There seems to be a few issues likely with one root cause. The three related symptoms seem to be:

If you have any details for reproducing this that would be appreciated. I have never been able to have this happen on my own machine. I am going to be spending time to fix this and hold off on new features until I can get the root cause figured out.

CodaBool commented 1 month ago

I was able to replicate it. I had to use a long latency remote instance of Foundry. I normally test my module locally and use a local network for my usage of Terminal. So, the behavior is very quick normally for me.

Here is how I replicated the bug:

1. create tile, enable it and give a journal. Save and close tile config
2. walk onto the tile with a token
3. keep the terminal open and change the scene
4. go back to original scene
5. open the tile config

I think the network latency changes how my JavaScript expects the HTML to be. I will need to make testing on long latency servers part of my release cycle.

But for now there are likely several unchecked issues with my code. I'll make this a priority for this week.

EDIT:

Seems an even simpler trigger is to just have a terminal open and open a tile's config

Looking at the JavaScript sources for the page. I see that the hooks file gets loaded twice. Once when the page is loaded like it should. Then another one when a terminal is first opened.

hooks

CodaBool commented 1 month ago

I was able to solve the issue by ensuring some of the Hook calls were only loaded once. Not sure why this is necessary for only The Forge and not for my local server. But I'll take the lessons learned for this.

Update to 2.2.0 to get this fix on your Foundry