Refactor timeline activity insert (#13696)
In this PR: - refactor timelineActivity computation to batch it - make sure to pass the authContext to insert-query-builder in order to pass user information to timelineActivity - refactor message-participant /calendar-participant creation to batch more - fix favorite on view race condition (FE) - deprecate PARTIAL_CALENDAR_EVENT_FETCH_LIST syncStage as we will deprecate partial vs full notion (we will just leverage cursor emptyness or not) - introduce calendar / messging SCHEDULED syncStage that will allow better performance granularity later - activate quick message import after message list fetch to speed performance on small message lists
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { checkStringIsDatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/utils/check-string-is-database-event-action';
|
||||
|
||||
export const computeEventName = (objectName: string, action: string) => {
|
||||
if (!checkStringIsDatabaseEventAction(action)) {
|
||||
throw new Error('Invalid action');
|
||||
}
|
||||
|
||||
return `${objectName}.${action}`;
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { checkStringIsDatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/utils/check-string-is-database-event-action';
|
||||
|
||||
export const parseEventNameOrThrow = (eventName: string) => {
|
||||
const [objectSingularName, action] = eventName.split('.');
|
||||
|
||||
if (!checkStringIsDatabaseEventAction(action)) {
|
||||
throw new Error('Invalid event name');
|
||||
}
|
||||
|
||||
if (!isDefined(objectSingularName)) {
|
||||
throw new Error('Invalid event name');
|
||||
}
|
||||
|
||||
return {
|
||||
objectSingularName,
|
||||
action,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user