mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-05 05:04:10 -05:00
fix(teams): webhook notifications crash (#2426)
* fix(docs): clarify working directory for drizzle migration (#2375) * fix(landing): prevent url encoding for spaces for footer links (#2376) * fix: handle empty body.value in Teams webhook notification parser (#2425) * Update directory path for migration command --------- Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: Waleed <walif6@gmail.com> Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com> Co-authored-by: icecrasher321 <icecrasher321@users.noreply.github.com> Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: mosa <mosaxiv@gmail.com> Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Shivam <shivamprajapati035@gmail.com> Co-authored-by: Gaurav Chadha <65453826+Chadha93@users.noreply.github.com> Co-authored-by: root <root@Delta.localdomain>
This commit is contained in:
@@ -188,6 +188,7 @@ DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio"
|
||||
|
||||
Then run the migrations:
|
||||
```bash
|
||||
cd packages/db # Required so drizzle picks correct .env file
|
||||
bunx drizzle-kit migrate --config=./drizzle.config.ts
|
||||
```
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ export default function Footer({ fullWidth = false }: FooterProps) {
|
||||
{FOOTER_BLOCKS.map((block) => (
|
||||
<Link
|
||||
key={block}
|
||||
href={`https://docs.sim.ai/blocks/${block.toLowerCase().replace(' ', '-')}`}
|
||||
href={`https://docs.sim.ai/blocks/${block.toLowerCase().replaceAll(' ', '-')}`}
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
className='text-[14px] text-muted-foreground transition-colors hover:text-foreground'
|
||||
|
||||
@@ -81,7 +81,11 @@ async function formatTeamsGraphNotification(
|
||||
foundWorkflow: any,
|
||||
request: NextRequest
|
||||
): Promise<any> {
|
||||
const notification = body.value[0]
|
||||
const notification = body.value?.[0]
|
||||
if (!notification) {
|
||||
logger.warn('Received empty Teams notification body')
|
||||
return null
|
||||
}
|
||||
const changeType = notification.changeType || 'created'
|
||||
const resource = notification.resource || ''
|
||||
const subscriptionId = notification.subscriptionId || ''
|
||||
@@ -359,7 +363,7 @@ async function formatTeamsGraphNotification(
|
||||
contentType: mimeType,
|
||||
size,
|
||||
})
|
||||
} catch {}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -634,24 +638,24 @@ export async function formatWebhookInput(
|
||||
|
||||
const senderObj = message.from
|
||||
? {
|
||||
id: message.from.id,
|
||||
firstName: message.from.first_name,
|
||||
lastName: message.from.last_name,
|
||||
username: message.from.username,
|
||||
languageCode: message.from.language_code,
|
||||
isBot: message.from.is_bot,
|
||||
}
|
||||
id: message.from.id,
|
||||
firstName: message.from.first_name,
|
||||
lastName: message.from.last_name,
|
||||
username: message.from.username,
|
||||
languageCode: message.from.language_code,
|
||||
isBot: message.from.is_bot,
|
||||
}
|
||||
: null
|
||||
|
||||
const chatObj = message.chat
|
||||
? {
|
||||
id: message.chat.id,
|
||||
type: message.chat.type,
|
||||
title: message.chat.title,
|
||||
username: message.chat.username,
|
||||
firstName: message.chat.first_name,
|
||||
lastName: message.chat.last_name,
|
||||
}
|
||||
id: message.chat.id,
|
||||
type: message.chat.type,
|
||||
title: message.chat.title,
|
||||
username: message.chat.username,
|
||||
firstName: message.chat.first_name,
|
||||
lastName: message.chat.last_name,
|
||||
}
|
||||
: null
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user