-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: test realtime webhook #493
Conversation
Qovery can create a Preview Environment for this PR.
This comment has been generated from Qovery AI 🤖.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
11681213 | Triggered | Generic High Entropy Secret | 61339fd | ngrok.yml | View secret |
11681213 | Triggered | Generic High Entropy Secret | 4cfc64b | ngrok.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
- Introduced real-time webhook functionality for Zendesk
- Added new models for file storage integrations in
schema.prisma
- Enhanced
handler.module.ts
to include additional modules - Updated sync services to handle real-time webhook triggers for accounts, contacts, tickets, and users
- Added default
sync
methods for individual entities across various service classes
await this.syncAccountsService.syncAccountsForLinkedUser( | ||
connection.provider_slug.toLowerCase(), | ||
connection.id_linked_user, | ||
connection.id_project, | ||
{ | ||
action: | ||
event_action.toLowerCase() == 'deleted' ? 'DELETE' : 'UPDATE', | ||
data: { remote_id: payload_.detail.id as string }, | ||
}, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing 'break' statement after 'organization' case.
async syncAccount( | ||
linkedUserId: string, | ||
remote_id: string, | ||
): Promise<ApiResponse<any[]>> { | ||
return { | ||
data: [], | ||
message: 'Default syncAccount implementation', | ||
statusCode: 200, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing the actual logic for syncing a single account instead of returning a default response.
return { | ||
data: [], | ||
message: 'Default syncAccount implementation', | ||
statusCode: 200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an empty data array might be misleading. Consider returning null or an appropriate message indicating that the method is not yet implemented.
return await this.removeAccountInDb( | ||
linkedUserId, | ||
integrationId, | ||
wh_real_time_trigger.data.remote_id, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure existingAccount
is checked for null before accessing its properties.
remote_account_id: string, | ||
): Promise<ApiResponse<GorgiasContactOutput[]>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the check for 'remote_account_id' might lead to issues if this parameter is required for the function to operate correctly.
this.logger.log(`Synced zendesk unique ticket !`); | ||
|
||
return { | ||
data: [resp.data.ticket], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure 'resp.data.ticket' is not undefined or null before returning it.
return await this.removeTicketInDb( | ||
linkedUserId, | ||
integrationId, | ||
wh_real_time_trigger.data.remote_id, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure removeTicketInDb
handles cases where existingTicket
is null to avoid runtime errors.
async syncUser( | ||
linkedUserId: string, | ||
remote_id: string, | ||
): Promise<ApiResponse<any[]>> { | ||
return { | ||
data: [], | ||
message: 'Default syncUser implementation', | ||
statusCode: 200, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing the actual logic for syncing a single user instead of returning a default response.
async syncUser( | ||
linkedUserId: string, | ||
remote_id: string, | ||
): Promise<ApiResponse<any[]>> { | ||
return { | ||
data: [], | ||
message: 'Default syncUser implementation', | ||
statusCode: 200, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing the actual logic for syncing a single user instead of returning a default response.
const existingUser = await this.prisma.tcg_users.findFirst({ | ||
where: { | ||
remote_id: remote_id, | ||
remote_platform: originSource, | ||
id_linked_user: linkedUserId, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if existingUser
is null before attempting to delete.
No description provided.