Skip to content

fix(trending): strip post emoji on the server only - #474

Merged
harlan-zw merged 1 commit into
mainfrom
fix/trending-quote-hydration
Oct 6, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/trending-quote-hydration

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Related to #473.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

After #473 deployed, /skills/trending and the homepage logged "Hydration completed but contains mismatches". The shared excerpt helper stripped emoji with \p{Extended_Pictographic} on the server and again in the browser. The two engines disagree about some characters: Node 24 does not count ★ as an emoji, and Chrome 145 does. So the server rendered 33.5k★ and the browser rendered 33.5k.

The loader's toEvidence now strips emoji and folds letter styles once, on the server. The feed and the track board ship plain text, and postExcerpt no longer uses Unicode property escapes or normalization. Both engines now cut the same text.

Where post text is cleaned: the loader strips once on the Worker, the presenters ship plain text, and the cards and excerpt helper render it unchanged in both engines

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

Production boards failed hydration after #473. The excerpt helper
stripped emoji on both sides, and Node 24 and Chrome 145 disagree about
which characters are emoji (`★`), so the server and the browser rendered
different quote text. The loader now strips once, and the page renders
the text it receives.
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-06 15:09 UTC.

GitHub merged this pull request.

  • Logged (10/100): The pull request's single evidence image is unreachable; the server-side cleaning flow is documented only in prose.
    • Ask an agent to verify and fix this finding
  • Logged (35/100): Count labels use locale-dependent toLocaleString, so server HTML and hydrated client text diverge for non-en-US visitors on every trending surface, repeating the mismatch class this pull request removes for post text. View code
    • Ask an agent to verify and fix this finding

59c69f7f-85f2-4c65-85c6-5e03caf79c30

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit 771bb40 into main Oct 6, 2026
7 checks passed
@harlan-zw
harlan-zw deleted the fix/trending-quote-hydration branch October 6, 2026 14:19
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant