Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

UserGroup undefined error when activating GroupInvitation. #81

Open
xanderjakeq opened this issue Feb 21, 2020 · 3 comments
Open

UserGroup undefined error when activating GroupInvitation. #81

xanderjakeq opened this issue Feb 21, 2020 · 3 comments

Comments

@xanderjakeq
Copy link

(Assuming #76 is resolved)

I got UserGroup undefined errors when activating a GroupInvitation.
The line below would be the problem.

https://github.com/blockstack/radiks/blob/0d97225e9b828d5348960236fdd4b83c266cbdaa/src/models/group-membership.ts#L91

The code above is trying to get the UserGroup of a GroupMembership model.

https://github.com/blockstack/radiks/blob/0d97225e9b828d5348960236fdd4b83c266cbdaa/src/models/group-membership.ts#L40

When the GroupMembership's UserGroup is deleted, it makes sense that the error would occur.

Should radiks handle this situation or should the app dev? @hstove

@friedger
Copy link
Collaborator

friedger commented Feb 22, 2020

@xanderjakeq Do you get the error only when the group was deleted? Could you please add a simple test?

I think radiks should handle this in a meaningful way for the developer.

@xanderjakeq
Copy link
Author

Here's some steps to replicate:

  1. user1 creates userGroup1.
  2. user1 invites user2 to userGroup1
  3. user2 activates Invitation to userGroup1
  4. user1 deletes userGroup1
  5. user1 creates userGroup2.
  6. user1 invites user2 to userGroup2
  7. user2 activates Invitation to userGroup2
  8. then should get a UserGroup undefined error

@friedger
Copy link
Collaborator

Ideally all memberships are deleted when deleting a group. At least fetching a usergroup from a membership should return {} if the group does not exist anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants