Upgrade to 1.16.2 - "reply" broken in Chrome after browser reload

Solved Technical Support
  • After upgrading to 1.16.2 the "reply" functionality no longer works if the page is reloaded

    To create the issue:

    1. Start with fresh login
    2. Test reply works (it does)
    3. Normal reload of the browser (CTRL-R)
    4. Test reply - does not work, button does nothing

    Errors in Chrome console immediately after logging in:
    72ae29a6-1f85-450b-9776-11c2117c9a67-image.png

    Errors in Chrome console immediately after sending CTRL-R:
    c01032ed-52ba-4dc4-95ae-e913bfd2980c-image.png

    Basically identical errors but now reply is not working. clicking the button/link for reply does not generate more errors, the clicks are ignored.

    There is one error in the nodebb logs which may be related:

    Error: Session Mismatch
        at validateSession (/home/nodebb/nodebb_root/src/socket.io/index.js:196:9)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async onMessage (/home/nodebb/nodebb_root/src/socket.io/index.js:143:3)
    

    Nothing obvious in the nginx access or error logs

    System

    Nodebb 1.16.2
    Mongod 4.0.20
    Redis version 4.0.9
    Node v12.21.0 (Tried with node v14 as in the documentation but that had other errors that were fixed with a downgrade)
    nginx 1.16.1
    npm 6.14.11

    This is with the latest version of Chrome

    164b9807-bd8e-469c-9350-b6388233056c-image.png

    Running with clustering enabling so the big change in this upgrade was having to install redis to allow that to work. As redis is now handling the sessions could that be the reason this is not working?

    As an possibly related issue, I am used to using our forum from multiple browser sessions almost concurrently (e.g. on mobile, on desktop). I now see session mismatch errors occasionally when switching. For the purposes of this test above I only had one session open to keep it simple.

  • As a further update. this means that when a link to a forum post is pasted into a browser where you already have a logged in session the new tab is effectively a browser reload and thus reply does not work.

  • I note that with this version of chrome the same errors similar errors are show with this forum:
    c0136686-fb8c-4d51-b446-4431c30ca380-image.png

    however reply does work here, even after a CTRL-R reload

    So I clearly have a misconfiguration somewhere in the backend.

  • Further update - Problem appears to be fixed.

    One difference in browser errors is the prepareFooter error:

    Uncaught ReferenceError: highlight is not defined
        at HTMLDocument.prepareFooter ((index):3508)
    

    Further digging showed that the prepareFooter() is where custom javascript is placed and that was the issue. Custom java script was breaking the page during prepareFooter() which killed the reply functionality (along with a lot of other things).

    The java script was there to add functionality to highlight.js for syntax highlighting. now to dig into what has changed with highlight.js in the latest version.


Suggested Topics