Bug: Invalid regular expression exception for emoji replacement in Firefox
#4,121 opened on Nov 2, 2022
Description
Steps to reproduce the behavior
- Go to the root path of the web server, i.e. localhost:8000
- See a blank page and an error.
Expected behavior
I see the welcome screen.
Edition and Platform
- Edition: Personal Server
- Version: 7.4.3
- Browser and OS: Firefox 68, Ubuntu 20.04
Symptom
Loading the main page causes a syntax error while parsing the main.js bundle due to an illegal regular expression.
SyntaxError: invalid identity escape in regular expression
Root cause
This is due to an illegal regular expression escape used here:
https://github.com/mattermost/focalboard/blob/v7.4.3/webapp/src/blocks/boardView.ts#L62
Proposal
A code search suggests that sortBoardViewsAlphabetically is not meaningfully used in the codebase; it only has callsites in unit tests.
It seems that it was previously used in webapp/src/components/sidebar/sidebarBoardItem.tsx, however as of aa540e73ce669a1acd491a5edd7d55199ef1b87c, its use was decommissioned and the original utility was not removed.
Removing this function altogether remediates the SyntaxError issue in my local environment. I propose this method and associated unit tests simply be removed.