MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / handleIssue

Function handleIssue

packages/integration-github/src/inbound.ts:76–93  ·  view source on GitHub ↗
(
  payload:
    | GitHubTypes.IssuesReopenedEvent
    | GitHubTypes.IssuesClosedEvent
    | GitHubTypes.IssuesOpenedEvent
)

Source from the content-addressed store, hash-verified

74
75// reusable between webhooks issue related
76async function handleIssue(
77 payload:
78 | GitHubTypes.IssuesReopenedEvent
79 | GitHubTypes.IssuesClosedEvent
80 | GitHubTypes.IssuesOpenedEvent
81) {
82 const { channel, externalThreadId } = await handleCommon(payload);
83 const user = await handleUser(payload.issue.user, channel);
84
85 const thread = Serializer.githubIssueToLinenThread(
86 payload.issue,
87 user.id,
88 channel.id,
89 channel.accountId,
90 externalThreadId
91 );
92 return thread;
93}
94
95// reusable: helper to identify channel and build thread external id
96async function handleCommon(

Callers 3

handleIssuesOpenedFunction · 0.85
handleIssuesClosedFunction · 0.85
handleIssuesReopenedFunction · 0.85

Calls 3

handleCommonFunction · 0.85
handleUserFunction · 0.70

Tested by

no test coverage detected