Skip to content

fix(aggregator): activity summary caps never split a surrogate pair (#7725) - #7730

Merged
dezren39 merged 1 commit into
mainfrom
creator-a/7725-activity-surrogate
Nov 8, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-a/7725-activity-surrogate

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7725

What

pm-stack/aggregator/src/activity.ts capped activity summaries with raw slice(0, 500) at four sites — the watchdog writer (:120), both kaneo writers (:196/:207), and the record-time persist cap in IngestionStore (:485) — splitting surrogate pairs and bypassing the capUnits guard #7694/#7711 merged today for actions.ts. A title whose emoji straddled the cap produced a persisted summary ending in a lone high surrogate, which any UTF-8 round-trip renders as U+FFFD.

This adds a local capUnits helper mirroring the actions.ts semantics (an astral character straddling the cap is dropped whole) and routes all four caps through it.

Verification

  • Probe (real module, laptop @ f9dfb4c): watchdog + kaneo straddle cases ended in lone \ud83d pre-fix; control (pair fully inside the cap) intact.
  • New regression tests in test/activity-3321.test.ts (watchdog straddle, watchdog exact-fit control, kaneo straddle, record-time cap via the link suffix): the 3 straddle tests fail on pre-fix code, all pass post-fix.
  • bun test test/activity-3321.test.ts: 20/20 pass. Full aggregator suite run on the branch (see PR checks / issue note for the result).

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 8, 2026 14:30
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7797c0f2-a28b-45b7-9dca-3f7741f25e40

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39 dezren39 added kind/bug Something isn't working (prefixed form of the classic bug label) source/creator Filed by the new-issue-creator job app/aggregator Package/app: aggregator (pm-stack in this repo) labels Nov 8, 2026
@dezren39
dezren39 merged commit 4e4c7ad into main Nov 8, 2026
3 of 5 checks passed
@dezren39
dezren39 deleted the creator-a/7725-activity-surrogate branch November 8, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app/aggregator Package/app: aggregator (pm-stack in this repo) kind/bug Something isn't working (prefixed form of the classic bug label) source/creator Filed by the new-issue-creator job

Projects

None yet

1 participant