vigoren / foundryvtt-simple-calendar

A simple calendar module for the FoundryVTT system
https://simplecalendar.info/
MIT License
48 stars 35 forks source link

[BUG] Simple calendar causes double client side messages to be posted #588

Closed roi007leaf closed 6 months ago

roi007leaf commented 6 months ago

Describe the bug In the latest version of Pf2e while using simple .calendar I get double persistent damage applied and double recovery check

To Reproduce Steps to reproduce the behavior: Set persistent damage on monster. Pass a turn so combatant will get persistent damage.

Expected behavior Only one message is posted

Screenshots If applicable, add screenshots to help explain your problem.

Foundry Information

Browser (please complete the following information): Chrome

Additional context Add any other context about the problem here.

Peach774 commented 6 months ago

This is a conflict with PF2e Toolbelt, not workbench

roi007leaf commented 6 months ago

Just checked and on 2.4.3 the bug doesn't happen

Peach774 commented 6 months ago

Yeah I want to expand on this a bit - it isn't a cross-module conflict. This occurs with ONLY simple calendar and pf2e. It isn't persistent damage duplicating or anything that sinister. It is chat messages duplicating clientside. It happens independently across users.

roi007leaf commented 6 months ago

after testing a bit this is the code change that made this bug happen @vigoren image reverting to precreate fixes it

vigoren commented 6 months ago

I have tracked down what seems to be the issue and am just spending some time running a few more tests to make sure nothing is double posted. An update should be released in roughly 24 hours at the latest.

vigoren commented 6 months ago

Sorry had some personal stuff come up yesterday but version 2.4.12 should address this. Please let me know if it doesn't

roi007leaf commented 6 months ago

@vigoren doesnt seem to be fixed, question though: why not just implement the fix i proposed that fixes this from my testing? a few comments up

vigoren commented 6 months ago

Then I am having difficulty replicating the issue as on my test version of PF2E I don't get duplicate messages for anything. Do you have a very simple example that can replicate it?

Your proposed fix causes errors with other systems, which is why I changed it.

roi007leaf commented 6 months ago

Make an encounter with just 1 monster, no pcs. Set persistent damage on it of any kind. Start the encounter. Pass a turn. You need to have workbench persistent damage automation turned on, or roll recovery check yourself.

vigoren commented 6 months ago

Thank you. Must have done something wrong the first time but now the messages are duplicated.

Interestingly it seems to only duplicate the first persistent damage roll and the first recovery check. Afterwards it does just single chat cards.

The damage appears to only be applied once though so it isn't duplicating anything other than the chat card.

Ok back to the drawing board I will keep digging into what is going on here. Sorry about this

roi007leaf commented 6 months ago

No problem, if I can help in any way, let me know

ariakas2008 commented 6 months ago

I can confirm this bug also in 2.4.12, it happens with some of the features of pf2 workbench, such "Automatically apply persistent damage" "..and automatically roll recovery after that" "Automatically apply persistent healing rolled by the system"

Seems not fixed to me.

vigoren commented 6 months ago

Ok this should be addressed now in version 2.4.13

I ended up going back to how this worked in 2.4.3 (which was released September 2023 and seemed to not have this issue at all) and then reapproached the original issue that caused me to change it. So all of the reported issues should be fixed.

ariakas2008 commented 6 months ago

Ok this should be addressed now in version 2.4.13

I ended up going back to how this worked in 2.4.3 (which was released September 2023 and seemed to not have this issue at all) and then reapproached the original issue that caused me to change it. So all of the reported issues should be fixed.

I can confirm it's fixed, thank you!