Upgrade to 1.16.2 - "reply" broken in Chrome after browser reload
-
After upgrading to 1.16.2 the "reply" functionality no longer works if the page is reloaded
To create the issue:
- Start with fresh login
- Test reply works (it does)
- Normal reload of the browser (CTRL-R)
- Test reply - does not work, button does nothing
Errors in Chrome console immediately after logging in:
Errors in Chrome console immediately after sending CTRL-R:
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.11This is with the latest version of Chrome
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.
-
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.