Skip to content

Commit d64ed6d

Browse files
KrisBraunclaude
andcommitted
Fix Linear issues showing as unread for the creator
Linear webhook payloads don't include creator/assignee data, so the author was never resolved and defaulted to the twist ID. This meant markThreadReadForAuthor always skipped, leaving issues unread for the user who created them. Now fetches the full issue from the API in the webhook handler to get the real creator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 96f8517 commit d64ed6d

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

connectors/linear/src/linear.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,30 @@ export class Linear extends Connector<Linear> {
721721
return;
722722
}
723723

724-
// Use issue data directly from webhook payload
725-
const creator = issue.creator || null;
726-
const assignee = issue.assignee || null;
724+
// Webhook payloads don't include creator/assignee — fetch from API
725+
let creator: { id: string; email?: string; name: string; avatarUrl?: string | null } | null = issue.creator || null;
726+
let assignee: { id: string; email?: string; name: string; avatarUrl?: string | null } | null = issue.assignee || null;
727+
728+
if (!creator || !assignee) {
729+
try {
730+
const client = await this.getClient(projectId);
731+
const fullIssue = await client.issue(issueId);
732+
if (!creator) {
733+
const apiCreator = await fullIssue.creator;
734+
if (apiCreator) {
735+
creator = { id: apiCreator.id, email: apiCreator.email, name: apiCreator.name, avatarUrl: apiCreator.avatarUrl };
736+
}
737+
}
738+
if (!assignee) {
739+
const apiAssignee = await fullIssue.assignee;
740+
if (apiAssignee) {
741+
assignee = { id: apiAssignee.id, email: apiAssignee.email, name: apiAssignee.name, avatarUrl: apiAssignee.avatarUrl };
742+
}
743+
}
744+
} catch (error) {
745+
console.error("Failed to fetch issue from API for creator/assignee:", error);
746+
}
747+
}
727748

728749
// Build thread update with only issue fields (no notes)
729750
const authorContact = this.resolveAuthorContact(creator);

0 commit comments

Comments
 (0)