Skip to content
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

BUG: Error assigning VC to member role. #4213

Closed
ccanos opened this issue Jul 5, 2024 · 1 comment
Closed

BUG: Error assigning VC to member role. #4213

ccanos opened this issue Jul 5, 2024 · 1 comment
Labels
bug Something isn't working server

Comments

@ccanos
Copy link
Contributor

ccanos commented Jul 5, 2024

Describe the bug

In acceptance, create a new VirtualContributor, error is thrown when assigning that VC as lead of the BoK subspace.

mutation AddVirtualContributorToCommunity(
  $communityId: UUID!
  $virtualContributorId: UUID_NAMEID!
) {
  assignCommunityRoleToVirtual(
    roleData: {
      communityID: $communityId
      role: MEMBER
      virtualContributorID: $virtualContributorId
    }
  ) {
    id
    __typename
  }
}
{
  "communityId": "0eb02155-b938-45a4-85de-341ff7ead93e",
  "virtualContributorId": "2a20f462-f651-4e51-a998-6f3fe6d93a27"
}
stacktrace":[9 items
0:"EntityNotFoundException: Unable to find space for community: 028d191b-e47e-43ff-93f2-95b386477a00"
1:" at new BaseException (/usr/src/app/dist/common/exceptions/base.exception.js:8:9)"
2:" at new EntityNotFoundException (/usr/src/app/dist/common/exceptions/entity.not.found.exception.js:8:9)"
3:" at CommunityResolverService.getSpaceForCommunityOrFail (/usr/src/app/dist/services/infrastructure/entity-resolver/community.resolver.service.js:212:19)"
4:" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
5:" at async CommunityEventsService.processCommunityNewMemberEvents (/usr/src/app/dist/domain/community/community/community.service.events.js:41:23)"
6:" at async CommunityService.contributorAddedToRole (/usr/src/app/dist/domain/community/community/community.service.js:367:21)"
7:" at async CommunityService.assignVirtualToRole (/usr/src/app/dist/domain/community/community/community.service.js:382:9)"
8:" at async CommunityResolverMutations.assignCommunityRoleToVirtual (/usr/src/app/dist/domain/community/community/community.resolver.mutations.js:129:9)"

The problem is caused by a mistake in these changes:
https://github.com/alkem-io/server/pull/4197/files#diff-0ee7cbe3862b3bdf48fcbd97ee7136fea162b7db7320372b7f32c859413d33b5
File src/domain/community/community/community.service.events.ts:53

getSpaceForCommunityOrFail(spaceID); expects a communityID

Can be fixed passing community.id, or using space repository to get the space directly.
(I recommend the first option, because I think, spaceID is the root spaceID, regarding the error thrown)

Needs notifications testing to make sure that the current space is referenced in the notification.

To Reproduce
Steps to reproduce the behavior:

  1. Go to acceptance / My Dashboard
  2. Click on Add virtual contributor (you'll need to have a space your user owns, less than 3 other VCs)
  3. Fill the form.
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Areas that will be affected as part of the fix
Optional, to be added by developer if relevant

@ccanos ccanos added bug Something isn't working High priority server and removed High priority labels Jul 5, 2024
@Comoque1
Copy link
Member

Comoque1 commented Jul 8, 2024

Closing. not reproducible on acc env.

@Comoque1 Comoque1 closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server
Projects
None yet
Development

No branches or pull requests

2 participants