Closed bardram closed 2 months ago
This could also be a CAWS bug. Let's have a look whether we have proper coverage of the Core part of this logic ...
Seemingly not. It should be worthwhile adding a more complex invitation test here similar to the scenario you describe.
Maybe a suitable small task for @yuanchen233 ? That way we can more easily determine whether it is CAWS or Core.
@Whathecode - I'm a bit confused. Is this a bug in Core or CAWS? Above you point to a test case, but this doesn't reveal (at least to me) if something has to be "fixed" in Core.
The code was sufficiently complex I couldn't quickly/easily rule it out as a core bug. It's missing test coverage to do so. I haven't looked into more detail.
So best approach is adding such a test so we have future coverage, and we'll know whether it is core or CAWS. :)
We don't have test case covering this scenario, thus can not tell if this is something need to be fixed in Core. I can look into this next.
But, the description for getActiveParticipationInvitations states 'all participations', so does this imply this result is expected?
But, the description for getActiveParticipationInvitations states 'all participations', so does this imply this result is expected?
It does qualify:
.... the account with the given [accountId] has been invited to.
So, it shouldn't return participations from other account IDs. ;)
I wrote a simple test case and Core implementation works as expected,
this bug is caused by CAWS implementation of ParticipationRepository.getParticipationInvitations
.
More specifically, participations
from all participantGroup
should be flattened before filter by accountId
, otherwise it will return all participations within a participant group which contains that accountId
.
Thank you @yuanchen233 Feel free to create a PR for the test case. It would still be relevant for core.
Reassigned this as an "enhancement" (providing test coverage) rather than a bug.
I just tested this on the new DEV deployment and now I only get the invitations I am supposed to get.
Thank you @yuanchen233 Feel free to create a PR for the test case. It would still be relevant for core.
Sure and thanks, I wanted to see if there are other situations/test cases can benefit from a more complex participant group as well, but didn't find anything right away. If this scenario can be re-used for testing other modules, I'll add it to createTestObject
.
I have made a family study with a father and a mother, and made a deployment with assignments to users like this:
So - Jakob is the "Mother" and Aamir is the "Father".
However, when I authenticate to CAWS as "Jakob" (jakob@bardram.net), I get the following invitations from the ParticipationService:
So - even though I autheticate as the "Mother" I get BOTH invitations????
This entails, that I (as a participant) could choose to be the Father, even though the researcher has assigned me the Mother role......