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

Function eventThreadUpdated

apps/web/services/events/eventThreadUpdated.ts:19–51  ·  view source on GitHub ↗
({
  channelId,
  messageId,
  threadId,
  imitationId,
  thread,
}: ThreadUpdatedEvent)

Source from the content-addressed store, hash-verified

17};
18
19export async function eventThreadUpdated({
20 channelId,
21 messageId,
22 threadId,
23 imitationId,
24 thread,
25}: ThreadUpdatedEvent) {
26 const event = {
27 channelId,
28 messageId,
29 threadId,
30 imitationId,
31 isThread: true,
32 isReply: false,
33 thread,
34 };
35
36 const promises: Promise<any>[] = [
37 createTwoWaySyncJob({ ...event, event: 'threadUpdated', id: messageId }),
38 ];
39
40 const account = await AccountsService.getAccountByThreadId(threadId);
41 if (!!account?.searchSettings && threadId) {
42 promises.push(
43 createTypesenseOnThreadUpdate({
44 threadId,
45 accountId: account.id,
46 })
47 );
48 }
49
50 await Promise.allSettled(promises);
51}

Callers 1

updateMethod · 0.90

Calls 3

createTwoWaySyncJobFunction · 0.90
getAccountByThreadIdMethod · 0.80

Tested by

no test coverage detected