fix: handle null user in comment transform#35
Open
ralfschimmel wants to merge 1 commit intoczottmann:mainfrom
Open
fix: handle null user in comment transform#35ralfschimmel wants to merge 1 commit intoczottmann:mainfrom
ralfschimmel wants to merge 1 commit intoczottmann:mainfrom
Conversation
Linear's agent protocol can create system comments with user: null. Add null-check to prevent "Cannot read properties of null" error when transforming issues with such comments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3 tasks
|
Hope this can get reviewed and merged soon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix crash when transforming issues that contain comments with
user: null.Problem
When running
linearis issues update(orread) on an issue that has comments created by Linear's Agent Protocol, the CLI crashes with:Stack trace:
Root Cause
Linear's Agent Protocol creates system comments (e.g., "This thread is for an agent session with bobbin.") where
userisnull. The transform code at line 889-892 assumescomment.useralways exists:Example Data That Fails
From the raw API response, these comments have
user: null:{ "id": "ec4c235a-f2f3-4650-abfa-587bb51610ef", "body": "This thread is for an agent session with bobbin.", "createdAt": "2025-12-28T12:13:47.400Z", "updatedAt": "2025-12-28T12:18:06.594Z", "user": null }Fix
useroptional inLinearCommentinterface (user?:instead ofuser:)assignee:Testing
After the fix, issues with agent protocol comments are processed correctly. Comments with null users simply omit the
userfield in the output.🤖 Generated with Claude Code