mclemente / fvtt-module-polyglot

Talk to others using a language you can speak and scrambles text you can't understand.
MIT License
41 stars 48 forks source link

Incompatibility with DF Chat Enhancements Chat Merge feature #228

Closed Ghostdesu closed 1 year ago

Ghostdesu commented 2 years ago

Module DF Chat Enhancements 3.6.0

Describe the issue Merged OOC messages unmerge whenever a token is selected on the canvas.

To Reproduce Steps to reproduce the behavior:

  1. Enable DF Chat Enhancements and Polyglot as well as their prerequisites.
  2. Put a token on the canvas.
  3. Send multiple messages in chat, making sure they merge.
  4. Select token.

Expected behavior Messages should remain merged.

Screenshots Nothing of note in the console. image

The issue chatmergebug

Additional context Testing was done using: Firefox 99.0.1 Foundry 9.266 Pathfinder 2e 3.8.4.11118 libWrapper 1.12.4.0 Library: Chat Commands 1.4.0 DF Chat Enhancements 3.6.0 Polyglot 1.7.38

I am also creating an issue on DF Chat Enhancements page in case it has to be fixed on their end.

mclemente commented 2 years ago

I couldn't replicate it. Could you share your Polyglot and DF Chat settings? image

Ghostdesu commented 2 years ago

Sorry for the late reply, I missed the notification.

After doing some testing it looks like this problem affects specifically unscrambled messages. (Notice how there's a globe in your screenshot but not mine.)

Here's an example side by side, messages on top before disabling scrambling OOC, messages below after disabling scrambling OOC: chatmerge

Ghostdesu commented 2 years ago

Here's a settings export using Forien's Copy Environment in case I missed something:

[
  {
    "key": "core.fontSize",
    "value": "6"
  },
  {
    "key": "core.leftClickRelease",
    "value": "true"
  },
  {
    "key": "core.maxFPS",
    "value": "20"
  },
  {
    "key": "core.nue.shownTips",
    "value": "true"
  },
  {
    "key": "core.performanceMode",
    "value": "1"
  },
  {
    "key": "df-chat-enhance.enabled",
    "value": "false"
  },
  {
    "key": "df-chat-enhance.replace-buttons",
    "value": "false"
  },
  {
    "key": "pf2e.ancestryParagonVariant",
    "value": "false"
  },
  {
    "key": "pf2e.dualClassVariant",
    "value": "false"
  },
  {
    "key": "pf2e.freeArchetypeVariant",
    "value": "false"
  },
  {
    "key": "pf2e.worldClock.worldCreatedOn",
    "value": "\"2022-04-17T22:20:27.919Z\""
  },
  {
    "key": "polyglot.allowOOC",
    "value": "\"d\""
  },
  {
    "name": "Gamemaster",
    "core": {
      "color": "#cc288c",
      "permissions": {},
      "role": 4
    },
    "flags": {
      "pf2e": {
        "settings": {
          "uiTheme": "blue",
          "showEffectPanel": true,
          "showRollDialogs": true,
          "darkvisionFilter": false
        }
      }
    }
  }
]
flamewave000 commented 2 years ago

I too have not been able to replicate the issue, but I'm also unfamiliar with how polyglot works. @mclemente if you have a way to repro, let me know and I can look into it as well. I'm not exactly sure how this is occurring, unless the messages are being removed from the chat log and then new HTML directly added, thereby bypassing the Chat Log's regular message draw.

mclemente commented 2 years ago

@flamewave000 I've managed to reproduce it after Ghostdesu's reply but forgot to post my findings because they were inconclusive.
I couldn't figure out how the bug happened, because going step-by-step on the debugger was no different from a normal state. Both functions were called the same way, but with a specific set of Polyglot settings it breaks the messages up as in the OP, but I couldn't see anything that should cause it.