Skip to content

The open alternative to Salesforce, designed for AI.

Rename 3 server files to the singular suffix in src/engine/core-modules/auth/constants (#28507)

twenty-pr-author[bot]d6d8833fcd2c
diff --git a/packages/twenty-server/src/engine/core-modules/auth/constants/auth-context-user-select-fields.constants.ts b/packages/twenty-server/src/engine/core-modules/auth/constants/auth-context-user-select-fields.constant.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/auth/constants/auth-context-user-select-fields.constants.ts
rename to packages/twenty-server/src/engine/core-modules/auth/constants/auth-context-user-select-fields.constant.ts
diff --git a/packages/twenty-server/src/engine/core-modules/auth/constants/max-workspaces-without-organization-key.constants.ts b/packages/twenty-server/src/engine/core-modules/auth/constants/max-workspaces-without-organization-key.constant.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/auth/constants/max-workspaces-without-organization-key.constants.ts
rename to packages/twenty-server/src/engine/core-modules/auth/constants/max-workspaces-without-organization-key.constant.ts
diff --git a/packages/twenty-server/src/engine/core-modules/auth/constants/microsoft-oauth-max-retry-attempts.constants.ts b/packages/twenty-server/src/engine/core-modules/auth/constants/microsoft-oauth-max-retry-attempts.constant.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/auth/constants/microsoft-oauth-max-retry-attempts.constants.ts
rename to packages/twenty-server/src/engine/core-modules/auth/constants/microsoft-oauth-max-retry-attempts.constant.ts
diff --git a/packages/twenty-server/src/engine/core-modules/auth/guards/microsoft-oauth.guard.ts b/packages/twenty-server/src/engine/core-modules/auth/guards/microsoft-oauth.guard.ts
index fc91f6041d0..400ffd634a9 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/guards/microsoft-oauth.guard.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/guards/microsoft-oauth.guard.ts
@@ -7,7 +7,7 @@ import { ApiPath } from 'twenty-shared/types';
import { parseJson } from 'twenty-shared/utils';
import { Repository } from 'typeorm';
-import { MICROSOFT_OAUTH_MAX_RETRY_ATTEMPTS } from 'src/engine/core-modules/auth/constants/microsoft-oauth-max-retry-attempts.constants';
+import { MICROSOFT_OAUTH_MAX_RETRY_ATTEMPTS } from 'src/engine/core-modules/auth/constants/microsoft-oauth-max-retry-attempts.constant';
import { type SocialSsoState } from 'src/engine/core-modules/auth/types/social-sso-state.type';
import { isMicrosoftOAuthTransientError } from 'src/engine/core-modules/auth/utils/is-microsoft-oauth-transient-error.util';
import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
index 8c178d985fd..c7032e2b19e 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
@@ -35,7 +35,7 @@ import {
PASSWORD_REGEX,
hashPassword,
} from 'src/engine/core-modules/auth/auth.util';
-import { MAX_WORKSPACES_WITHOUT_ENTERPRISE_KEY } from 'src/engine/core-modules/auth/constants/max-workspaces-without-organization-key.constants';
+import { MAX_WORKSPACES_WITHOUT_ENTERPRISE_KEY } from 'src/engine/core-modules/auth/constants/max-workspaces-without-organization-key.constant';
import { getSignUpWithoutWorkspaceDecision } from 'src/engine/core-modules/auth/utils/get-sign-up-without-workspace-decision.util';
import { hasProvisionedSignUpDestination } from 'src/engine/core-modules/auth/utils/has-provisioned-sign-up-destination.util';
import {
diff --git a/packages/twenty-server/src/engine/core-modules/auth/types/auth-context.type.ts b/packages/twenty-server/src/engine/core-modules/auth/types/auth-context.type.ts
index 556be637320..3e7775b8d65 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/types/auth-context.type.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/types/auth-context.type.ts
@@ -1,2 +1,2 @@
-export { AUTH_CONTEXT_USER_SELECT_FIELDS } from 'src/engine/core-modules/auth/constants/auth-context-user-select-fields.constants';
+export { AUTH_CONTEXT_USER_SELECT_FIELDS } from 'src/engine/core-modules/auth/constants/auth-context-user-select-fields.constant';
export { type FlatAuthContextUser as AuthContextUser } from 'src/engine/core-modules/auth/types/flat-auth-context-user.type';
diff --git a/packages/twenty-server/src/engine/core-modules/auth/types/flat-auth-context-user.type.ts b/packages/twenty-server/src/engine/core-modules/auth/types/flat-auth-context-user.type.ts
index 4da8aee8289..d37c0f0701d 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/types/flat-auth-context-user.type.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/types/flat-auth-context-user.type.ts
@@ -1,4 +1,4 @@
-import { type AUTH_CONTEXT_USER_SELECT_FIELDS } from 'src/engine/core-modules/auth/constants/auth-context-user-select-fields.constants';
+import { type AUTH_CONTEXT_USER_SELECT_FIELDS } from 'src/engine/core-modules/auth/constants/auth-context-user-select-fields.constant';
import { type FlatUser } from 'src/engine/core-modules/user/types/flat-user.type';
export type FlatAuthContextUser = Pick<
diff --git a/packages/twenty-server/test/integration/ai/suites/agent-run-wait.integration-spec.ts b/packages/twenty-server/test/integration/ai/suites/agent-run-wait.integration-spec.ts
index dd59287612c..f02bc8c7415 100644
--- a/packages/twenty-server/test/integration/ai/suites/agent-run-wait.integration-spec.ts
+++ b/packages/twenty-server/test/integration/ai/suites/agent-run-wait.integration-spec.ts
@@ -52,6 +52,20 @@ const findSuspensions = (callerType: string, agentId: string) =>
[callerType, agentId],
);
+// the turn stops running before the run's wake-up is armed, so the suspension is read until it shows
+const findSuspensionEventually = async (
+ callerType: string,
+ agentId: string,
+) => {
+ await expectEventually(async () => {
+ expect(await findSuspensions(callerType, agentId)).toHaveLength(1);
+ });
+
+ const [suspension] = await findSuspensions(callerType, agentId);
+
+ return suspension;
+};
+
const findWaitCallStatus = async (threadId: string) => {
const [part] = await global.testDataSource.query(
`SELECT part."toolOutput"->'result'->>'status' AS status FROM "${schema}"."agentMessagePart" part
@@ -156,7 +170,7 @@ describe('agent runs that wait (integration)', () => {
await runTrigger();
- const [suspension] = await findSuspensions('AGENT_TRIGGER', agentId);
+ const suspension = await findSuspensionEventually('AGENT_TRIGGER', agentId);
expect(suspension).toMatchObject({
ownerType: 'AGENT_RUN',
@@ -203,7 +217,7 @@ describe('agent runs that wait (integration)', () => {
await runTrigger();
- const [{ id: wakeUpId, threadId }] = await findSuspensions(
+ const { id: wakeUpId, threadId } = await findSuspensionEventually(
'AGENT_TRIGGER',
agentId,
);