Repository navigation
fix: v1.8.1 — strip date and name residue leaking into spoken body - #11
Conversation
DATE_RE \b boundaries fail when Angular renders inline elements without
whitespace (e.g. "AliceMay 20"); removed in favour of the already-specific
\s+\d{1,2} suffix. normalizeMsg now also strips individual sender-name
words and leading badge words to close the loop on the
FirstName MonthDay FullName message pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29226c6d0b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const DATE_RE = /\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+\d{1,2}(?:,?\s*\d{4})?\b/gi; | ||
| // No \b boundaries — the Angular DOM can concatenate inline elements without spaces | ||
| // (e.g. "AliceMay 20"), which breaks \b. The \s+\d{1,2} suffix is specific enough. | ||
| const DATE_RE = /(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+\d{1,2}(?:,?\s*\d{4})?/gi; |
There was a problem hiding this comment.
Reinstate end boundary in date-stripping regex
Removing the trailing \b from DATE_RE makes the cleaner delete month/day substrings inside normal words such as "May 20th" (it now strips "May 20" and leaves "th"). This is a regression from the previous pattern and will corrupt spoken message content whenever users include ordinal dates, even though those are not UI-injected date chips.
Useful? React with 👍 / 👎.
| msg.fullSender.split(/\s+/).filter(p => p.length > 1).forEach(part => { | ||
| msg.body = stripSenderFromStart(msg.body, part); |
There was a problem hiding this comment.
Require word boundary when stripping sender name parts
The new per-word sender stripping pass calls stripSenderFromStart for each token of fullSender, but that helper matches raw prefixes without a boundary. This means a sender part can delete the start of an unrelated word (e.g., sender "Ann Lee", body "Leeds won" becomes "ds won"), causing message text corruption in production chat reads.
Useful? React with 👍 / 👎.
Summary
DATE_REword-boundary fix —\bsilently fails when the Angular DOM concatenates inline elements without whitespace (e.g.AliceMay 20). Boundaries removed; the\s+\d{1,2}suffix is already discriminating enough.normalizeMsgnow strips each individual word offullSenderfrom the body start, then sweeps leading badge words. Closes the loop on theFirstName MonthDay FullName messagepattern that was regressing.Test plan
[Streaming Message Reader] UI mounted.in DevTools console with no errors<username>: <message>only (no date, no duplicate name)🤖 Generated with Claude Code