Skip to content

fix(web): parse /api/commit bodies containing field separators#1081

Closed
msukkari wants to merge 2 commits intomainfrom
cursor/recent-pr-bugs-ca61
Closed

fix(web): parse /api/commit bodies containing field separators#1081
msukkari wants to merge 2 commits intomainfrom
cursor/recent-pr-bugs-ca61

Conversation

@msukkari
Copy link
Copy Markdown
Contributor

@msukkari msukkari commented Apr 2, 2026

Summary

  • Fix getCommit parsing so commit bodies containing the field separator (\x1f) do not corrupt authorName, authorEmail, or parents.
  • Add a focused unit test that reproduces the separator-in-body parsing failure and verifies the corrected output shape.
  • Add a changelog entry under [Unreleased]Fixed for this bugfix PR.

Reproduction (before fix)

  • Reproduced with a real temporary git repository by creating a commit whose body contains \x1f and running the same split logic used by getCommit.
  • Observed malformed parsing (fields_length=9, body split unexpectedly, shifted author fields).

Validation (after fix)

  • Targeted parser test passes: src/features/git/getCommitApi.test.ts.
  • Regression safety test passes: src/features/git/listCommitsApi.test.ts.
  • Reproduction script rerun with fixed extraction logic shows correct body/author/parent mapping despite fields_length=9.

Fixes #1077

Open in Web Open in Cursor 

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 26e251e8-7567-48df-b4f6-cbb48f23bade

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/recent-pr-bugs-ca61

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@msukkari msukkari closed this Apr 3, 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.

2 participants