mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-06 21:54:01 -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:
|
Then run the migrations:
|
||||||
```bash
|
```bash
|
||||||
|
cd packages/db # Required so drizzle picks correct .env file
|
||||||
bunx drizzle-kit migrate --config=./drizzle.config.ts
|
bunx drizzle-kit migrate --config=./drizzle.config.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export default function Footer({ fullWidth = false }: FooterProps) {
|
|||||||
{FOOTER_BLOCKS.map((block) => (
|
{FOOTER_BLOCKS.map((block) => (
|
||||||
<Link
|
<Link
|
||||||
key={block}
|
key={block}
|
||||||
href={`https://docs.sim.ai/blocks/${block.toLowerCase().replace(' ', '-')}`}
|
href={`https://docs.sim.ai/blocks/${block.toLowerCase().replaceAll(' ', '-')}`}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener noreferrer'
|
rel='noopener noreferrer'
|
||||||
className='text-[14px] text-muted-foreground transition-colors hover:text-foreground'
|
className='text-[14px] text-muted-foreground transition-colors hover:text-foreground'
|
||||||
|
|||||||
@@ -81,7 +81,11 @@ async function formatTeamsGraphNotification(
|
|||||||
foundWorkflow: any,
|
foundWorkflow: any,
|
||||||
request: NextRequest
|
request: NextRequest
|
||||||
): Promise<any> {
|
): 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 changeType = notification.changeType || 'created'
|
||||||
const resource = notification.resource || ''
|
const resource = notification.resource || ''
|
||||||
const subscriptionId = notification.subscriptionId || ''
|
const subscriptionId = notification.subscriptionId || ''
|
||||||
@@ -359,7 +363,7 @@ async function formatTeamsGraphNotification(
|
|||||||
contentType: mimeType,
|
contentType: mimeType,
|
||||||
size,
|
size,
|
||||||
})
|
})
|
||||||
} catch {}
|
} catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -634,24 +638,24 @@ export async function formatWebhookInput(
|
|||||||
|
|
||||||
const senderObj = message.from
|
const senderObj = message.from
|
||||||
? {
|
? {
|
||||||
id: message.from.id,
|
id: message.from.id,
|
||||||
firstName: message.from.first_name,
|
firstName: message.from.first_name,
|
||||||
lastName: message.from.last_name,
|
lastName: message.from.last_name,
|
||||||
username: message.from.username,
|
username: message.from.username,
|
||||||
languageCode: message.from.language_code,
|
languageCode: message.from.language_code,
|
||||||
isBot: message.from.is_bot,
|
isBot: message.from.is_bot,
|
||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
|
|
||||||
const chatObj = message.chat
|
const chatObj = message.chat
|
||||||
? {
|
? {
|
||||||
id: message.chat.id,
|
id: message.chat.id,
|
||||||
type: message.chat.type,
|
type: message.chat.type,
|
||||||
title: message.chat.title,
|
title: message.chat.title,
|
||||||
username: message.chat.username,
|
username: message.chat.username,
|
||||||
firstName: message.chat.first_name,
|
firstName: message.chat.first_name,
|
||||||
lastName: message.chat.last_name,
|
lastName: message.chat.last_name,
|
||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user