From bd18eb8b427fae01f74c12c82f590964b3a1efda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 15 Nov 2024 14:16:09 +0100 Subject: [PATCH] Add logging for scopeid error (#8513) Can't figure out https://github.com/twentyhq/twenty/issues/8347 so I'm adding logs, maybe it'll help debug in the future! --- .github/workflows/ci-utils.yaml | 4 +++- .../scopes-internal/hooks/useAvailableScopeId.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-utils.yaml b/.github/workflows/ci-utils.yaml index 7a7ef38042..352e40c858 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 6dd6b2ed5b..02a902c0ec 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 = ( } 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'}`, + ); } };