Skip to content

fix(server): workflow reference titles no longer end in half an emoji - #43392

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
only21mil:fix/server-workflow-reference-title-surrogate
Nov 26, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
only21mil:fix/server-workflow-reference-title-surrogate

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

A workflow run keeps the title of each issue or pull request it touches, cut to 300 UTF-16 code units. The cut was a plain slice, so when an emoji straddles code units 299 and 300 it keeps the emoji's first half. SQLite stores that half as U+FFFD, so the run's references come back with a title ending in �.

The broken half also defeats the store's "nothing new" check. The fresh cut still holds the lone half, but the stored row holds �, so the two never match. Every later touch of the same issue or pull request then rewrites the row and publishes a change notice, even when nothing changed.

Change

referenceNoted now cuts one code unit earlier when the cut would split a surrogate pair, using the splitsSurrogatePair check the step result, failure detail, run title and subject title cuts in the same file already use (#41723, #41808, #41924).

Scope

A small fix of an obvious bug, so no issue needed. This is the same broken-character cut those earlier fixes made in the same file, on the one title cut they did not cover. Every other text cut in apps/server/src/workflows/ already guards surrogate pairs.

Verification

An AI agent ran each check below.

  • A new test in WorkflowStore.test.ts checks three titles:
    • 299 a + 🚀 is stored as 299 a.
    • 298 a + 🚀, with the emoji ending exactly at 300, keeps the emoji.
    • 301 a is stored as 300 a.
  • The same test then notes the first reference again with nothing new and checks that no change notice is published.
  • On main the test fails, because the stored title ends in �. With the fix, WorkflowStore.test.ts passed 30 of 30 tests in each of 3 runs.
  • The real noteFor → WorkflowStore.referenceNoted path ran against a SQLite file built by the real migrations, with a title of 299 a + 🚀 + more text, noting it once and then twice more unchanged:
main This PR
Title length returned by references() 300 299
Last stored bytes (sqlite3 hex(title)) …61 EF BF BD (�) …61 61 61
Change notices from 2 identical repeat touches 2 0
  • vp run check:changed passed.
  • Not shown: a screenshot. The run page's reference chip cuts long titles with an ellipsis well before 300 characters, so the bad last character never reaches the screen. The fix shows in the stored data and the change notices above.

Generated with Claude Opus 5.5 in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

referenceNoted now truncates titles without splitting a surrogate pair at the 300-character limit. Tests cover emoji boundaries, long plain titles, and unchanged references.

Changes: Reference title truncation

Layer / File(s) Summary
Truncation behavior and tests
apps/server/src/workflows/WorkflowStore.ts, apps/server/src/workflows/WorkflowStore.test.ts
referenceNoted adjusts the truncation boundary when it would split a surrogate pair. Tests cover emoji boundary cases, overlong plain titles, and unchanged references.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 8be08

Reference titles are no longer cut in the middle of an emoji at the 300-unit limit, so repeat touches stop rewriting rows and publishing spurious change notices. The change is small and tested, and no merge-blocking risk is apparent.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(server): workflow reference titles no longer end in half an emoji" names the main change: reference titles are cut without leaving a broken surrogate-pair character. It matches the Work…
Description check Passed The description follows the template. Problem explains the split surrogate pair, the stored U+FFFD replacement character, and the repeated change notices. Change explains the fix in referenceNoted and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(server): workflow reference titles no longer end in half an emoji" names the main change: reference titles are cut without leaving a broken surrogate-pair character. It matches the WorkflowStore.referenceNoted change and the new test. It is a conventional commit title in plain language, as the template asks.

Full details: Description check

Explanation

The description follows the template. Problem explains the split surrogate pair, the stored U+FFFD replacement character, and the repeated change notices. Change explains the fix in referenceNoted and reuses the existing splitsSurrogatePair check. Scope says why no issue is needed for a small obvious bug, and it cites the earlier related fixes. Verification lists focused tests with observed results, a before/after table of the SQLite path, and the check run. It also states what was not checked, namely the screenshot, with a reason. It names the model and harness used. The description is complete and meets the template's requirements.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a111d59 and 8be08b8.

Files selected for processing: 1

  • apps/server/src/workflows/WorkflowStore.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 26, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Created real Linear issues with 299 ASCII characters followed by 🚀 and a suffix, plus a 298-character control. On fresh databases, opened Workflows and ran a single step reading each issue three times. The scenario runner exited 0: failed on base and passed on head.

Before After
147028a265 8be08b8b47
Stored split title: 300 UTF-16 units, ending EF BF BD (�). Two reference-bearing updates during the step. Stored split title: 299 intact UTF-16 units. One reference-bearing update during the step.
Stored bytes and live trace Stored bytes and live trace
Before: completed workflow After: completed workflow
Before recording After recording

The control preserved the complete rocket within 300 units and emitted one update on both commits. The chip visually truncates these titles; the linked server traces show the character boundary and update difference.

Scenario source

Not shown:

  • The trailing character is not visually exposed in the chip screenshots because the app truncates its label. Stored title bytes and live RPC traces demonstrate the defect and fix.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 26, 2026
@juliusmarminge
juliusmarminge merged commit b7c4f0a into pingdotgg:main Nov 26, 2026
55 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 26, 2026
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…pingdotgg#43392)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit b7c4f0a)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…pingdotgg#43392)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit b7c4f0a)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…pingdotgg#43392)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit b7c4f0a)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…pingdotgg#43392)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit b7c4f0a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants