DeepChat UI renders multiple times, wiping out message history
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3545006. --> Reported by: [lpeabody](https://www.drupal.org/user/1137356) Related to !865 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When message history is turned on and set to a positive number, I have observed that the UI does render with the message history, but there is a subsequent render that occurs that wipes out message history and DOES NOT cause the render event listener to respond, indicating the the event listeners are getting wiped out on the element after the initial render.</p> <p>I have reproduced this issue on several codebases.</p> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <p>Please provide information like AI modules enabled, which AI provider, browser, etc.</p> <p>Turn on message history and set to a positive number.<br> Send a message.<br> Reload the page.<br> See that no messages are loaded.</p> <p>In Chrome, you can set a breakpoint in deepchat.bundle.js in the onRender method and see that the messages are loaded in the UI, and then onRender is called again and wiped out the messages without invoking the render listener from deepchat-init.js.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3> <p>At this time, I have blocked many different JS files from loading to try and narrow down the cause of the re-render. toolbar.js seems to be a significant cause. Whenever its JS file is not blocked the UI always renders twice. If I block the file from loading, the UI only renders once most of the time.</p>
issue