[Low Priority] Word Filter silently fails when an invalid regex is entered
维护者通常 1 天内回复
评估
- 难度
- 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.9k
- 派生
- 3.4k
- 平均合并
- 1 天 52 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
monkeytypegame/monkeytype 的其他 Issue
-
Bug: outOfFocusTimeouts array grows unboundedly — cleared timeout ids never removed from array可能已有人在做 @priyanshu1976 于 51 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
monkeytypegame/monkeytype#8366 ·
维护者通常 1 天内回复
-
Bug: HTML entity replacements missing semicolons (</>) — sliced entities render as garbage text in typed-word overlay可能已有人在做 @boergeson 于 51 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
monkeytypegame/monkeytype#8365 · 1 条评论 ·
维护者通常 1 天内回复
-
Bug (backend): dead null check in newQuotes.approve() — git === null never true, git init failure crashes with raw TypeError可能已有人在做 @boergeson 于 51 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
monkeytypegame/monkeytype#8364 · 1 条评论 ·
维护者通常 1 天内回复
-
Bug (backend): cacheWithTTL marks cache fresh before fetch resolves — failed fetch serves stale data for full TTL, no in-flight dedup可能已有人在做 @boergeson 于 51 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
monkeytypegame/monkeytype#8363 ·
维护者通常 1 天内回复
-
Bug (Monkey Power): reset() deletes timeout id before clearTimeout — pending shake reset always fires; randomColor() can emit invalid hex可能已有人在做 @boergeson 于 51 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
monkeytypegame/monkeytype#8362 · 1 条评论 ·
维护者通常 1 天内回复
查看 monkeytypegame/monkeytype 的全部 Issue
相似的 Issue
-
[Android] Nested transforms are composed in reverse order可能已有人在做 @Danyalo 今天认领。 未关闭Repro provided
难度 2/5 1-3 小时 新手友好度 74/100
software-mansion/react-native-svg#3090 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
radix-ui/primitives#4228 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 95/100
rocketride-org/rocketride-server#2705 · 1 条评论 ·
维护者通常 1 天内回复
-
archon-ready archon-size-s archon-type-bug area: web
难度 2/5 1-3 小时 新手友好度 82/100
coleam00/Archon#4707 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
HarperFast/grafana-datasource#177 ·