mattermost-community/focalboard

Bug: Invalid regular expression exception for emoji replacement in Firefox

Aperta

#4121 aperta il 2 nov 2022

 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (2542 fork)user submission
BugHelp WantedSev/2Up for grabs

Metriche repository

Star
 (26.187 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Steps to reproduce the behavior

  1. Go to the root path of the web server, i.e. localhost:8000
  2. 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.

Guida contributor