PalisadoesFoundation / talawa-api

API Backend for the Talawa Mobile App. Click on the link below to see our documentation
https://docs.talawa.io/
GNU General Public License v3.0
221 stars 792 forks source link

User membershipRequest showing unexpected behavior #2242

Open Azad99-9 opened 6 months ago

Azad99-9 commented 6 months ago

Describe the bug before testing set org's userRegistrationRequired: true.

Three cases of unexpected behaviour related to membershipRequests

case 1. Everytime register with a fresh account, new membershipRequest is being added to org's membershipRequests field but not to user's membershipRequests field.

case 2. Even if the requests are being added to the org's membershipRequests field but they are not fetchable in the org's query.

case 3. As soon as we send a request through the sendMembershipRequest mutation all the previously added requests are also now fetchable.

To Reproduce Steps to reproduce the behavior:

Case 1:

  1. Register with a fresh account
  2. check the org's membershipRequests field
  3. check the new user's membershipRequests field You will notice the membershipRequest is will be added to the org's membershipRequests field but the same will not be reflected in the user's membershipRequests field.

case 1.webm

Case 2:

  1. signup with multiple new accounts to a single org.
  2. Now compare org's membershipRequests list in the database and the membershipRequests list fetched by the organizations query. you will notice a mismatch of number of requests.

https://github.com/PalisadoesFoundation/talawa-api/assets/120930148/161d1161-e841-47f2-a722-fcaf96b6a737

Remember this org to reproduce case 3.

Case 3:

  1. Signup with a fresh account by choosing an org different from the org used in case 2.
  2. Now use sendMembershipRequest mutation and send a request to the org said in case 2.
  3. Now compare org's membershipRequests list in the database and the membershipRequests list fetched by the organizations query. you will notice the mismatch of number of requests disappears.

https://github.com/PalisadoesFoundation/talawa-api/assets/120930148/961e8ca9-d89e-4da9-8e1a-156200b8b1bd

Additional details Add any other context or screenshots about the feature request here.

Potential internship candidates Please read this if you are planning to apply for a Palisadoes Foundation internship https://github.com/PalisadoesFoundation/talawa/issues/359

AVtheking commented 6 months ago

I would like to work on it .

hg6658 commented 6 months ago

Assign me this issue please

github-actions[bot] commented 6 months ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

Azad99-9 commented 6 months ago

Hey @AVtheking any update on this?

AVtheking commented 6 months ago

Hi @Azad99-9 was busy due to my exams.. will start working on it from tomorrow.

AVtheking commented 5 months ago

Unassigning myself busy in some other issue.

github-actions[bot] commented 5 months ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

Chaitanya1672 commented 4 months ago

I would like to work on this issue

github-actions[bot] commented 4 months ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

Chaitanya1672 commented 4 months ago

Working on it

github-actions[bot] commented 3 months ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

Chaitanya1672 commented 3 months ago

I am unassigning myself from my due to being occupied with other commitments.

github-actions[bot] commented 3 months ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

syedali237 commented 2 months ago

Can I be assigned this issue?

syedali237 commented 2 months ago

Working on it might take a few days..

syedali237 commented 1 month ago

I've fixed case 1. Would you prefer I submit a PR for this now, or should I complete the fixes for the other two cases first and then make a single PR?

Azad99-9 commented 1 month ago

please do everything in a single PR and share a video of it too.

syedali237 commented 1 month ago

@Azad99-9 I am not sure but this issue might be an internal error with Apollo Server (https://github.com/apollographql/apollo-client/issues/8898). I'm seeing the same problem when fetching members via the organization query. It seems like a broader issue with how certain queries are handled. Also on console logging the organization, it shows all the accurate data. Could we look into this? @palisadoes

syedali237 commented 1 month ago

@Azad99-9 @palisadoes Should I raise a PR for case 1 of this issue?

github-actions[bot] commented 1 month ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

syedali237 commented 1 month ago

@varshith257 Should I go ahead and raise a PR for the fixes so far? I'm still working on the other two cases but wanted to check in.

varshith257 commented 1 month ago

If you think needed multiple prs, go ahead

github-actions[bot] commented 4 weeks ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.