Skip to content

The open alternative to Salesforce, designed for AI.

Add logging for scopeid error (#8513)

Félix Malfaitbd18eb8b427f
diff --git a/.github/workflows/ci-utils.yaml b/.github/workflows/ci-utils.yaml
index 7a7ef38042d..352e40c8586 100644
--- a/.github/workflows/ci-utils.yaml
+++ b/.github/workflows/ci-utils.yaml
@@ -15,7 +15,9 @@ permissions:
statuses: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
+ # We don't cancel in-progress because this workflow is triggered on
+ # pull_request_target, which means the ref can be the same accross two PRs.
+ # cancel-in-progress: true
jobs:
danger-js:
diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId.ts
index 6dd6b2ed5b9..02a902c0ec2 100644
--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId.ts
+++ b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId.ts
@@ -17,6 +17,10 @@ export const useAvailableScopeIdOrThrow = <T extends { scopeId: string }>(
} else if (isNonEmptyString(scopeIdFromContext)) {
return scopeIdFromContext;
} else {
- throw new Error('Scope id is not provided and cannot be found in context.');
+ throw new Error(
+ `Scope id is not provided and cannot be found in context.\n` +
+ `Context: ${Context.displayName || 'Unknown'}\n` +
+ `ScopeInternalContext.scopeId: ${scopeInternalContext?.scopeId || 'Unknown'}`,
+ );
}
};