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 Report: SignUp (Mobile) #2454

Closed
ArinNigam opened this issue Apr 3, 2024 · 12 comments · Fixed by #2477
Closed

Bug Report: SignUp (Mobile) #2454

ArinNigam opened this issue Apr 3, 2024 · 12 comments · Fixed by #2477
Assignees
Labels
bug Something isn't working

Comments

@ArinNigam
Copy link

Describe the bug

The Talawa App is not able to run locally because of certain GrapphQL errors on the client side

image

On server Talawa-API userRegistrationRequired is not defined for the type Organizations in types.ts

image

During Login there is a GraphQL error

image
image

image

To Reproduce
Steps to reproduce the behavior:

  1. Fix Login by taking care of appUserProfile
  2. Fix Sign Up by taking care of userRegistrationRequired

Expected behavior
Run Talawa Mobile successfully without any errors.

Actual behavior

  • Error while login and signup.
  • Error fetching organizations.

Additional details
I'll create an issue in Talawa-API to add the particular fields described in screenshot in types.ts

Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship #359

@ArinNigam ArinNigam added the bug Something isn't working label Apr 3, 2024
@ArinNigam
Copy link
Author

I would like to work on this issue

@github-actions github-actions bot added the unapproved Unapproved, needs to be triaged label Apr 3, 2024
@Cioppolo14 Cioppolo14 removed the unapproved Unapproved, needs to be triaged label Apr 4, 2024
@Cioppolo14
Copy link

@ArinNigam Before working on this, please verify this issue is happening in the develop march. Please close this if it is not needed.

@ArinNigam
Copy link
Author

The error is being caused by userRegistrationRequired. The server issue has been closed. Apparently the fields are present in develop branch and I mistook main branch as the develop

Though the issue with SignUp and Login still exist at client side:

GraphQLError(message: Cannot return null for non-nullable field Organization.userRegistrationRequired.

Untitled2.mov
Untitled1.mov

@ArinNigam
Copy link
Author

ArinNigam commented Apr 14, 2024

Hi, just checked that sample imports were old in my databases and were causing issues for login and signup where it was giving userRegistrationRequired to be null since it was not defined in the database initially.

Login.mp4
Signup.mp4

Login works perfectly fine. But still there is an issue persists with signup which is most probably be caused from the server side. Attaching the logs

This is when you click on signup after filling all the details

From Server

error Field "UserInput.selectedOrganization" of required type "ID!" was not provided. {
"locations": [
    {
        "line": 3,
        "column": 16
    }
],
"extensions": {
    "code": "GRAPHQL_VALIDATION_FAILED",
     "stacktrace": [
        "GraphQLError: Field \"UserInput.selectedOrganization\" of required type \"ID!\" was not provided.",
        "    at Object.ObjectValue (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js:64:13)",
        "    at Object.enter (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/graphql/language/visitor.js:301:32)",
        "    at Object.enter (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/graphql/utilities/TypeInfo.js:391:27)",
        "    at visit (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/graphql/language/visitor.js:197:21)",
        "    at validate (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/graphql/validation/validate.js:91:24)",
        "    at processGraphQLRequest (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/@apollo/server/src/requestPipeline.ts:247:40)",
        "    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "    at internalExecuteOperation (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/@apollo/server/src/ApolloServer.ts:1313:12)",
        "    at runHttpQuery (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/@apollo/server/src/runHttpQuery.ts:232:27)",
        "    at runPotentiallyBatchedHttpQuery (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/@apollo/server/src/httpBatching.ts:85:12)",
        "    at ApolloServer.executeHTTPGraphQLRequest (/Users/arinnigam/Desktop/AppDev/talawa/talawa-api/node_modules/@apollo/server/src/ApolloServer.ts:1087:14)"
    ]
}
}

From Client

I/flutter (17501): ServerException(
  originalException: null, 
  originalStackTrace: null, 
  parsedResponse: 
    Response
      (data: null,
      errors: [GraphQLError(message: Field "UserInput.selectedOrganization" of required type "ID!" was not provided.,
      locations: null, path: null, extensions: null)],
      context: Context({ResponseExtensions: Instance of 'ResponseExtensions'}), 
      response: {
        errors: [{message: Field "UserInput.selectedOrganization" of required type "ID!" was not provided.,
        status: GRAPHQL_VALIDATION_FAILED,
        data: []}]}
      ))

The current issue persists for SignUp page which is most probably is being caused from the server side. I would like to know to if there is any existing issue in talawa-api who are working on this thing or should I link this issue and create one on talawa-api.


I am not closing this issue since there still persists an issue with signup on the mobile app. Once it gets solved on the backend side. I'll close this issue.

@ArinNigam ArinNigam changed the title Bug Report: Login and SignUp (Mobile) Bug Report: SignUp (Mobile) Apr 14, 2024
@Azad99-9
Copy link

Azad99-9 commented Apr 15, 2024

Hey @ArinNigam
I appreciate you efforts for finding out these bugs.

The login flow is working without any errors in the latest upstream.

For the signup part, after making the required changes to the mutation locally and fixing some minor bugs in the backend it's working fine. Which I will push into the select organization issue's #2330 PR.
backend signup bug PalisadoesFoundation/talawa-api#2203

So I guess the bugs related to login and signup will be fixed.

Login
https://github.com/PalisadoesFoundation/talawa/assets/120930148/4c961662-3ceb-4483-9d77-edee87572a64

Signup
https://github.com/PalisadoesFoundation/talawa/assets/120930148/9fdb4ca6-bb33-4a16-b0be-8a340ede92f7

Currently logout feature is not working as expected. Probably you can raise an issue for that and start working on it.

@ArinNigam
Copy link
Author

Hi, @Azad99-9

Yeah the backend issue needs to be solved for making the signup work.

I also made some changes locally on the client side and signup is working fine for me. Though some tests files are failing due to which I am not raising any PR. If you have any insights regarding how to fix unit tests that you can give?

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
No matching calls. All calls: MockDataBaseMutationFunctions.init(),
MockDataBaseMutationFunctions.gqlNonAuthMutation(
    '        mutation{
              signUp(data: {firstName: "", lastName: "", email: "", password: "",
selectedOrganization: "3"})
              {
                appUserProfile{
                  adminFor{
                    _id
                    name
                  }
                  createdOrganizations{
                    _id
                    name
                    image
                    description
                    userRegistrationRequired
                    creator{
                      _id
                      firstName
                      lastName
                      image
                    }
                  }
                }
                user{
                    _id
                    firstName
                    lastName
                    email
                    image
                    joinedOrganizations{
                      _id
                      name
                      image
                      description
                      userRegistrationRequired
                      creator{
                        _id
                        firstName
                        lastName
                        image
                      }
                    }
                    membershipRequests{
                      organization{
                        _id
                        name
                        image
                        description
                        userRegistrationRequired
                        creator{
                          _id
                          firstName
                          lastName
                          image
                        }
                      }
                    }
                  }
                  refreshToken
                  accessToken
                }
            }
        ', {variables: null, reCall: true})
(If you called `verify(...).called(0);`, please instead use `verifyNever(...);`.)

When the exception was thrown, this was the stack:
#0      fail (package:matcher/src/expect/expect.dart:149:31)
#1      _VerifyCall._checkWith (package:mockito/src/mock.dart:797:7)
#2      _makeVerify.<anonymous closure> (package:mockito/src/mock.dart:1071:18)
#3      main.<anonymous closure>.<anonymous closure> (file:///Users/arinnigam/Desktop/AppDev/talawa/talawa/test/view_model_tests/pre_auth_view_models/signup_details_view_model_test.dart:116:13)
<asynchronous suspension>
#4      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:183:15)
<asynchronous suspension>
#5      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1017:5)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

The test description was:
  Check if signup() is working fine when selected organization is not empty and public
════════════════════════════════════════════════════════════════════════════════════════════════════
SignUpWorking.mp4

@Azad99-9
Copy link

Please share me the code of test case which you are working on.

@ArinNigam
Copy link
Author

ArinNigam commented Apr 16, 2024

Please share me the code of test case which you are working on.

Here 6 test cases fails in sign_up_details_view_model_test.dart

image

@GlenDsza
Copy link

GlenDsza commented Apr 16, 2024

@ArinNigam @Azad99-9 isn't this issue (linked PR) and #2330 the same?

@Azad99-9
Copy link

Azad99-9 commented Apr 17, 2024

@palisadoes @GlenDsza No this issue's PR and the issue #2330 are not same. But yes this issue is a prerequisite for the issue #2330.

@palisadoes kindly reopen #2330 as still there is a significant amount of work pending to make the membershipRequest flow work as expected. Moreover the current request flow is highly bug prone.

Recording of current organization request flow.

memerror.mp4

The issues are

  1. The application is prompting that the membership request already exist even if its the first time to register.
  2. The request sent to the org is not properly being stored in the database leading to not showing the user's request in admin portal.

These both issues are related to Mobile client and needs to be fixed.

@palisadoes
Copy link
Contributor

#2330 is already reopened

@palisadoes palisadoes reopened this Apr 17, 2024
@github-project-automation github-project-automation bot moved this from Done to In progress in `userType` Remediation Apr 17, 2024
@Azad99-9
Copy link

@palisadoes my bad, I am sorry for the confusion. My intention was to answer to @GlenDsza 's question and to convey that #2330 is a bigger problem.

This prerequisite issue can be closed as it solves the sign up bug.

@github-project-automation github-project-automation bot moved this from In progress to Done in `userType` Remediation Apr 17, 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
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants