-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
/rest/batch/people very slow response when payload incorrect #5523
Comments
Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :). To address the slow response when the payload is incorrect, consider adding validation and error handling in the // In fetch-by-batch.service.ts
private validatePayload(payload: any): boolean {
// Add your validation logic here
return payload && payload.firstName && payload.lastName;
}
async fetchBatch(queries: any[], accessToken: string, batchOffset: number, batchLimit: number, boundary: string): Promise<AxiosResponse> {
if (!this.validatePayload(queries[0])) {
throw new Error('Invalid payload');
}
// Existing implementation
} This will ensure that invalid payloads are caught early, reducing the time taken to respond with an error. References/packages/twenty-server/src/modules/messaging/services/fetch-by-batch.service.ts |
@martmull would you have any idea where this could come from? It seems 200 for batch response are very fast but 500 are slow. I would have expected the opposite as 200 involves writing to the DB and doing more things |
can't reproduce |
Closing for now, please don't hesitate to reopen the issue if the pb persists, I might miss something when trying to reproduce |
Bug Description
Example:
As you can see, firstname and lastname are put incorrectly.
I get a 520 but it takes minutes to get back an answer. Which is pretty slow
Expected behavior
Quicker response
The text was updated successfully, but these errors were encountered: