[Low Priority] Word Filter silently fails when an invalid regex is entered
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
エラーは WordFilterModal.tsx の 137 行目で新しい RegExp が構築される箇所に起因します。まず、207 行目付近の onSubmit ハンドラーを調べてください。RegExp を作成する前に検証を追加し、ユーザーにエラーメッセージを表示します。エラーモーダルの表示方法については、UI コンポーネントライブラリを確認してください。単語フィルターモーダルに '(' や '[' などの無効な正規表現を入力してテストします。
索引モデルが issue の本文から書いたものです。
説明
Did you clear cache before opening an issue?
- I have cleared my cache
Is there an existing issue for this?
- I have searched the existing open and closed issues
Does the issue happen when logged in?
Yes
Does the issue happen when logged out?
Yes
Does the issue happen in incognito mode when logged in?
Yes
Does the issue happen in incognito mode when logged out?
Yes
Account name
onedeath
Account config
Doesn't only happen when logged in, but just in case my config is
{"theme":"metaverse","themeLight":"serika","themeDark":"serika_dark","autoSwitchTheme":false,"customTheme":false,"customThemeColors":["#323437","#e2b714","#e2b714","#646669","#2c2e31","#d1d0c5","#ca4754","#7e2a33","#ca4754","#7e2a33"],"favThemes":["stealth","rgb","terminal","cyberspace","vscode","metaverse","matrix","shadow","midnight","dark","arch","husqy","dev"],"showKeyTips":true,"smoothCaret":"fast","codeUnindentOnBackspace":false,"quickRestart":"tab","punctuation":false,"numbers":false,"words":100,"time":15,"mode":"custom","quoteLength":[0,1,2,3],"language":"english","fontSize":2,"freedomMode":false,"difficulty":"normal","blindMode":false,"quickEnd":false,"caretStyle":"outline","paceCaretStyle":"outline","flipTestColors":false,"layout":"default","funbox":[],"confidenceMode":"off","indicateTypos":"off","compositionDisplay":"replace","timerStyle":"mini","liveSpeedStyle":"mini","liveAccStyle":"mini","liveBurstStyle":"mini","colorfulMode":false,"randomTheme":"off","timerColor":"main","timerOpacity":"1","stopOnError":"off","deleteOnError":"off","showAllLines":false,"keymapMode":"off","keymapStyle":"staggered","keymapLegendStyle":"lowercase","keymapLayout":"overrideSync","keymapKeys":"minimal","keymapSize":1,"fontFamily":"Kanit","smoothLineScroll":false,"alwaysShowDecimalPlaces":false,"alwaysShowWordsHistory":false,"singleListCommandLine":"on","capsLockWarning":true,"playSoundOnError":"off","playSoundOnClick":"off","soundVolume":0.5,"startGraphsAtZero":true,"showOutOfFocusWarning":true,"paceCaret":"off","paceCaretCustomSpeed":100,"repeatedPace":true,"accountChart":["on","on","on","on"],"minWpm":"off","minWpmCustomSpeed":100,"highlightMode":"letter","typedEffect":"keep","typingSpeedUnit":"wpm","ads":"result","hideExtraLetters":false,"strictSpace":false,"minAcc":"off","minAccCustom":90,"monkey":false,"repeatQuotes":"off","resultSaving":true,"oppositeShiftMode":"off","customBackground":"","customBackgroundSize":"cover","customBackgroundFilter":[0,1,1,1],"customLayoutfluid":["qwerty","dvorak"],"customPolyglot":["english","german"],"monkeyPowerLevel":"off","minBurst":"off","minBurstCustomSpeed":100,"burstHeatmap":false,"britishEnglish":false,"lazyMode":false,"showAverage":"off","showPb":false,"tapeMode":"off","tapeMargin":50,"maxLineWidth":0,"playTimeWarning":"off"}
Current Behavior
Entering an invalid regular expression in Custom Text → Word Filter and clicking Set or Add does nothing. No error message appears, no filter is applied, and the Word Filter modal remains open.
Honestly in my testing I've only tried the brackets '[' , ']' , and parentheses , '(' . ')', but I think other invalid regex should produce the same result.
Moreover, the Words Filter screen is unable to be opened until you refresh after you enter the invalid regex expression.
Expected Behavior
I expected the site to clearly show an error such as “Invalid regex expression” so the user knows why the filter was not applied. Instead the only error indicator is the lack of response when clicking Set or Add, or if you're a bit tech-savvy, the error in DevTools ->
WordFilterModal.tsx:137 Uncaught (in promise) SyntaxError: Invalid regular expression: /(/: Unterminated group
at new RegExp ()
at oM (WordFilterModal.tsx:137:18)
at Object.onSubmit (WordFilterModal.tsx:207:24)
at async Rg._handleSubmit (FormApi.js:561:9)
Steps To Reproduce
- Go to the main screen
- Enter the 'Custom' mode
- Click change next to the mode selector
- Click on the button with a funnel icon reading 'words filter'
- In the regex field, put any invalid regex expression such as parentheses or brackets
- No visible error modal
Environment
- OS: Windows 11
- Browser: Google Chrome
- Browser Version: 153.0.8010.54 (Official Build) (64-bit) (cohort: Control)
Anything else?
No response
- 主要言語
- TypeScript
- スター
- 20.7k
- フォーク
- 3.3k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
monkeytypegame/monkeytype のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
monkeytypegame/monkeytype#8366 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
monkeytypegame/monkeytype#8365 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
monkeytypegame/monkeytype#8364 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
monkeytypegame/monkeytype#8363 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
monkeytypegame/monkeytype#8362 · コメント 1 件 ·
monkeytypegame/monkeytype の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
bcgov/bc-wallet-mobile#4761 · コメント 1 件 ·
-
external-issue to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100