radiks
radiks copied to clipboard
`UserGroup undefined` error when activating GroupInvitation.
(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
@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.
Here's some steps to replicate:
-
user1
createsuserGroup1
. -
user1
invitesuser2
touserGroup1
-
user2
activatesInvitation
touserGroup1
-
user1
deletesuserGroup1
-
user1
createsuserGroup2
. -
user1
invitesuser2
touserGroup2
-
user2
activatesInvitation
touserGroup2
- then should get a
UserGroup undefined
error
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.