ConnectyCube / connectycube-flutter-sdk-releases

ConnectyCube Flutter SDK Releases
7 stars 1 forks source link

Not able to signUp user if user is not found(404 error) #76

Closed subhangiP closed 1 year ago

subhangiP commented 2 years ago

if user is not found then we are trying to signup the user to connectycube but not getting error callback in the code. Please check the below connectycube methods and logs - Code -

 _loginToCC(BuildContext context, CubeUser user) {
    if (CubeSessionManager.instance.isActiveSessionValid() &&
        CubeSessionManager.instance.activeSession!.user != null) {
      if (CubeChatConnection.instance.isAuthenticated()) {
        loader.hideLoader(context);
        CallManager.instance.init(context);
        navigateToLoginScreen(_loginSuccessMsg);
      } else {
        _loginToCubeChat(context, user);
      }
    } else {
      createSession(user).then((cubeSession) {
        var tempUser = user;
        user = cubeSession.user!..password = tempUser.password;
        SharedPref.saveNewUser(user);
        _loginToCubeChat(context, user);
      }).catchError((error) {
        log('login - _loginToCC --' + error);
        if (error is ResponseException) {
          if (error.toString().contains("User not found")) {
            _signInCC(context, user);
          }
        } else {
          _processLoginError(error);
        }
      });
    }
  }

  _signInCC(BuildContext context, CubeUser user) async {
    if (!CubeSessionManager.instance.isActiveSessionValid()) {
      try {
        await createSession();
      } catch (error) {
        _processLoginError(error);
      }
    }
    signUp(user).then((newUser) {
      user.id = newUser.id;
      SharedPref.saveNewUser(user);
      signIn(user).then((result) {
        _loginToCubeChat(context, user);
      });
    }).catchError((exception) {
      _processLoginError(exception);
    });
  }

  void _loginToCubeChat(BuildContext context, CubeUser user) {
    PushNotificationsManager.instance.init();
    ChatNotificationsManager.instance.init();
    CubeChatConnection.instance.login(user).then((cubeUser) {
      loader.hideLoader(context);
      PrintLog.printLog("Login==ConnetyCube");
      navigateToLoginScreen(_loginSuccessMsg);
    }).catchError((exception) {
      PrintLog.printLog('login - _loginToCubeChat --' + exception);
      _processLoginError(exception);
    });
  }

logs -

flutter: CB-SDK: : =========================================================
flutter: === REQUEST ==== 09de20da-bd78-4897-adab-4e59a3db4381 ===
flutter: REQUEST
flutter:   POST https://api.connectycube.com/session
flutter: HEADERS
flutter:   {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 2.0.9, CB-Token: }
flutter: BODY
flutter:   {"application_id":"5858","auth_key":"yr-LkMB82ksb9CF","nonce":"867786225","timestamp":"1643385476","signature":"bf034182e8b68c5f94c92fce3dca3a63c1da7cf6","user":{"login":"bb494cacc90946cf9cdc20487626389b","email":"test1@yopmail.com","password":"123456"}}
flutter:
flutter: CB-SDK: : *********************************************************
flutter: *** RESPONSE *** 404 *** 09de20da-bd78-4897-adab-4e59a3db4381 ***
flutter: HEADERS
flutter:   {connection: keep-alive, content-type: application/json; charset=utf-8, date: Fri, 28 Jan 2022 15:57:58 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 29, server: nginx/1.16.1}
flutter: BODY
flutter:   {"errors":["User not found"]}
flutter:
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: type 'ResponseException' is not a subtype of type 'String'
TatankaConCube commented 2 years ago

could you please provide a full log not only one line with exception? One note - our SDK returns an instance of ResponseException in the catchError callback. If you need the string with an error message you can call exception.toString()

subhangiP commented 2 years ago

@TatankaConCube Not getting callback in error block. please check below full log

The plugin `flutter_voip_push_notification` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main_dev.dart on vivo 1917 in debug mode...
Running Gradle task 'assembleDevDebug'...
Note: /Users/subhangipawar/Downloads/softwareDownload/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.3/android/src/main/java/io/flutter/plugins/deviceinfo/DeviceInfoPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/subhangipawar/Downloads/softwareDownload/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-2.4.5/android/src/main/java/io/flutter/plugins/firebase/crashlytics/FlutterFirebaseCrashlyticsPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/subhangipawar/Downloads/softwareDownload/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-11.2.5/android/src/main/java/io/flutter/plugins/firebase/messaging/JobIntentService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/subhangipawar/Downloads/softwareDownload/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_login_facebook-1.2.0/android/src/main/java/ru/innim/flutter_login_facebook/FlutterLoginFacebookPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/subhangipawar/Downloads/softwareDownload/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-5.2.3/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/subhangipawar/Downloads/softwareDownload/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.11/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
✓  Built build/app/outputs/flutter-apk/app-dev-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...
W/FlutterActivityAndFragmentDelegate( 7781): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
I/flutter ( 7781): Observatory listening on ************************************
W/FlutterActivityAndFragmentDelegate( 8073): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
I/flutter ( 8073): Observatory listening on ************************************
I/flutter ( 8073): ROOT WIDGET 
I/flutter ( 8073): MyApp WIDGET Init /
I/flutter ( 8073): MyApp WIDGET 
I/flutter ( 8073): /
I/flutter ( 8073): Settings:----
I/flutter ( 8073): FetchCmsPagesList()
I/flutter ( 8073): [getToken] fcm token: fv4jP9SjTzKuu6_Z_G9CST:APA91bGmE3mVrvYVa6X0igk5JKRyzu_VEN5GJDA17CcjB33XoD5_8EEiUplFy3svumUqNrNAabDjKSsJVVQwgM8vow8DOr1osdy4KdaIyhdu_yLLBcjYx9r71YCOUbQ-XonjNd0TVAUj
I/flutter ( 8073): *** Request ***
I/flutter ( 8073): uri: **************************************************************
I/flutter ( 8073): method: GET
I/flutter ( 8073): responseType: ResponseType.json
I/flutter ( 8073): followRedirects: true
I/flutter ( 8073): connectTimeout: 60000
I/flutter ( 8073): sendTimeout: 60000
I/flutter ( 8073): receiveTimeout: 60000
I/flutter ( 8073): receiveDataWhenStatusError: true
I/flutter ( 8073): extra: {}
I/flutter ( 8073): headers:
I/flutter ( 8073):  application: x-www-form-urlencoded
I/flutter ( 8073):  Accept: application/json
I/flutter ( 8073): data:
I/flutter ( 8073): null
I/flutter ( 8073): 
I/flutter ( 8073): *** Response ***
I/flutter ( 8073): uri: **************************************************************
I/flutter ( 8073): statusCode: 200
I/flutter ( 8073): headers:
I/flutter ( 8073):  cache-control: no-cache, private
I/flutter ( 8073):  max-age=1, private
I/flutter ( 8073):  transfer-encoding: chunked
I/flutter ( 8073):  access-control-allow-origin: *
I/flutter ( 8073):  date: Sun, 30 Jan 2022 13:02:19 GMT
I/flutter ( 8073):  strict-transport-security: max-age=63072000; includeSubDomains; preload
I/flutter ( 8073):  x-robots-tag: noindex, nofollow
I/flutter ( 8073):  content-type: application/json
I/flutter ( 8073):  access-control-max-age: 1000
I/flutter ( 8073):  x-xss-protection: 1; mode=block
I/flutter ( 8073):  server: Apache
I/flutter ( 8073):  access-control-allow-headers: X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding, lang-code, allowed-domain, content-range, content-disposition, X-TEACHER-APP-LOGIN-TOKEN, Referer
I/flutter ( 8073):  access-control-allow-credentials: true
I/flutter ( 8073):  access-control-allow-methods: POST, GET, OPTIONS, DELETE, PUT
I/flutter ( 8073):  x-frame-options: SAMEORIGIN
I/flutter ( 8073):  x-content-type-options: nosniff
I/flutter ( 8073): Response Text:
I/flutter ( 8073): {"meta":{"status":true,"message":"Success","message_code":"SUCCESS","status_code":200},"data":{"content-page-list":[{"id":1,"slug":"about-us","status":"Active","created_by":null,"updated_by":null,"created_at":"2021-12-20T12:44:35.000000Z","updated_at":"2021-12-20T12:44:35.000000Z","deleted_at":null,"url":"*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
I/flutter ( 8073): 
I/flutter ( 8073): Transition { currentState: CmsInitState(), event: FetchCmsPagesList(), nextState: CmsSuccessState(null, CmsPagesListResponse([ContentPageList(1, about-us, Active, null, null, 2021-12-20T12:44:35.000000Z, 2021-12-20T12:44:35.000000Z, null), ContentPageList(2, privacy-policy, Active, null, null, 2021-12-20T12:56:46.000000Z, 2021-12-20T12:56:46.000000Z, null), ContentPageList(3, legal-discalimer, Active, null, null, 2021-12-20T11:30:36.000000Z, 2021-12-20T11:30:36.000000Z, null)])) }
I/flutter ( 8073): Change { currentState: CmsInitState(), nextState: CmsSuccessState(null, CmsPagesListResponse([ContentPageList(1, about-us, Active, null, null, 2021-12-20T12:44:35.000000Z, 2021-12-20T12:44:35.000000Z, null), ContentPageList(2, privacy-policy, Active, null, null, 2021-12-20T12:56:46.000000Z, 2021-12-20T12:56:46.000000Z, null), ContentPageList(3, legal-discalimer, Active, null, null, 2021-12-20T11:30:36.000000Z, 2021-12-20T11:30:36.000000Z, null)])) }
I/flutter ( 8073): CMS List :-- legal-discalimer
I/flutter ( 8073): /login
I/flutter ( 8073): Settings:----
I/flutter ( 8073): Login 
I/flutter ( 8073): [getToken] fcm token : fv4jP9SjTzKuu6_Z_G9CST:APA91bGmE3mVrvYVa6X0igk5JKRyzu_VEN5GJDA17CcjB33XoD5_8EEiUplFy3svumUqNrNAabDjKSsJVVQwgM8vow8DOr1osdy4KdaIyhdu_yLLBcjYx9r71YCOUbQ-XonjNd0TVAUj
I/flutter ( 8073): LoginEditMobileEmailClick()
I/flutter ( 8073): API request ::[MapEntry(email: *****************), MapEntry(password: Admin@123), MapEntry(device_token: fv4jP9SjTzKuu6_Z_G9CST:APA91bGmE3mVrvYVa6X0igk5JKRyzu_VEN5GJDA17CcjB33XoD5_8EEiUplFy3svumUqNrNAabDjKSsJVVQwgM8vow8DOr1osdy4KdaIyhdu_yLLBcjYx9r71YCOUbQ-XonjNd0TVAUj), MapEntry(device_type: Android)]
I/flutter ( 8073): Transition { currentState: LoginInitialState(), event: LoginEditMobileEmailClick(), nextState: LoginLoadingState() }
I/flutter ( 8073): Change { currentState: LoginInitialState(), nextState: LoginLoadingState() }
I/flutter ( 8073): *** Request ***
I/flutter ( 8073): uri: ***********************************************************
I/flutter ( 8073): method: POST
I/flutter ( 8073): responseType: ResponseType.json
I/flutter ( 8073): followRedirects: true
I/flutter ( 8073): connectTimeout: 60000
I/flutter ( 8073): sendTimeout: 60000
I/flutter ( 8073): receiveTimeout: 60000
I/flutter ( 8073): receiveDataWhenStatusError: true
I/flutter ( 8073): extra: {}
I/flutter ( 8073): headers:
I/flutter ( 8073):  application: x-www-form-urlencoded
I/flutter ( 8073):  Accept: application/json
I/flutter ( 8073):  content-type: application/json; charset=utf-8
I/flutter ( 8073): data:
I/flutter ( 8073): Instance of 'FormData'
I/flutter ( 8073): 
I/flutter ( 8073): *** Response ***
I/flutter ( 8073): uri: ***********************************************************
I/flutter ( 8073): statusCode: 200
I/flutter ( 8073): headers:
I/flutter ( 8073):  cache-control: no-cache, private
I/flutter ( 8073):  max-age=1, private
I/flutter ( 8073):  transfer-encoding: chunked
I/flutter ( 8073):  access-control-allow-origin: *
I/flutter ( 8073):  date: Sun, 30 Jan 2022 13:08:19 GMT
I/flutter ( 8073):  strict-transport-security: max-age=63072000; includeSubDomains; preload
I/flutter ( 8073):  x-robots-tag: noindex, nofollow
I/flutter ( 8073):  content-type: application/json
I/flutter ( 8073):  access-control-max-age: 1000
I/flutter ( 8073):  x-xss-protection: 1; mode=block
I/flutter ( 8073):  server: Apache
I/flutter ( 8073):  access-control-allow-headers: X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding, lang-code, allowed-domain, content-range, content-disposition, X-TEACHER-APP-LOGIN-TOKEN, Referer
I/flutter ( 8073):  access-control-allow-credentials: true
I/flutter ( 8073):  access-control-allow-methods: POST, GET, OPTIONS, DELETE, PUT
I/flutter ( 8073):  x-frame-options: SAMEORIGIN
I/flutter ( 8073):  x-content-type-options: nosniff
I/flutter ( 8073): Response Text:
I/flutter ( 8073): {"meta":{"status":true,"message":"User is loggedin","message_code":"USER_LOGGEDIN","status_code":200},"data":{"token_type":"Bearer","expires_in":31535999,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI0IiwianRpIjoiNzk1ZDMwZWMzN2VhMDEyZDU3MGY1OGYxZGY4ZDI2MzE0NmI1YmUyYmY2MDZlZGI5YTVlNTkzYzU0YTA3YjExZWQ3ZjEwYzQwYTcxZmYxYTUiLCJpYXQiOjE2NDM1NDgxMDAuODgxNjYyLCJuYmYiOjE2NDM1NDgxMDAuODgxNjY2LCJleHAiOjE2NzUwODQwOTkuMjk4OTQzLCJzdWIiOiIzIiwic2NvcGVzIjpbXX0.F-1aUkaScgyzgefcUda34MG3Mfw1b4o6iKm3xBAdfqUaekxB4DcWFxlMlg2kx6Hw0NJUI3lQrl2W3DE2cRMloNbtIKFj8pbb0krUlY6NUxo91deC7i-wE1W0J0S8Bn1QCId03THjxWKgD0xxwmAkmzyLmTbe0Kwc2L5pb9i2M53yYPYwofatAvi4QwMl60OcbSu6sNEatsKn30jREt0sLRhKIzqmHc6UvBBwu_6WzOXzwt8vno5Dicn7OLZpEEaE2KqQz_jTlpb5U4kHJHzywjpAFaiMJobKUxRlXPNzdOUrezgyZlCDDySHkzKbftwCdrhJ2ZtfXpicZ5XToNcLv-1czsOcBqSj8sDeUw_wNTHBbC2ohLS8IFYkCFoMZJrU09o2S5c4KOJJ4xniLD01VP9-znzxNx3hA-dZOebQkB1cnCJcDK7ZiPBuFcpRqQf1MQIeu0bJUfELu643L-exm2rnC52RK8bWQ76DqjtNNuEJ90aQVWRclQ_T9CzveWZwBf-4Hb4KFySQplpSh0XYQ-0lJS6nnXnx9EyS_Puy8NFS
I/flutter ( 8073): 
I/flutter ( 8073): Transition { currentState: LoginLoadingState(), event: LoginEditMobileEmailClick(), nextState: LoginSuccessState(User is loggedin, LoginResponse(Bearer, 31535999, eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI0IiwianRpIjoiNzk1ZDMwZWMzN2VhMDEyZDU3MGY1OGYxZGY4ZDI2MzE0NmI1YmUyYmY2MDZlZGI5YTVlNTkzYzU0YTA3YjExZWQ3ZjEwYzQwYTcxZmYxYTUiLCJpYXQiOjE2NDM1NDgxMDAuODgxNjYyLCJuYmYiOjE2NDM1NDgxMDAuODgxNjY2LCJleHAiOjE2NzUwODQwOTkuMjk4OTQzLCJzdWIiOiIzIiwic2NvcGVzIjpbXX0.F-1aUkaScgyzgefcUda34MG3Mfw1b4o6iKm3xBAdfqUaekxB4DcWFxlMlg2kx6Hw0NJUI3lQrl2W3DE2cRMloNbtIKFj8pbb0krUlY6NUxo91deC7i-wE1W0J0S8Bn1QCId03THjxWKgD0xxwmAkmzyLmTbe0Kwc2L5pb9i2M53yYPYwofatAvi4QwMl60OcbSu6sNEatsKn30jREt0sLRhKIzqmHc6UvBBwu_6WzOXzwt8vno5Dicn7OLZpEEaE2KqQz_jTlpb5U4kHJHzywjpAFaiMJobKUxRlXPNzdOUrezgyZlCDDySHkzKbftwCdrhJ2ZtfXpicZ5XToNcLv-1czsOcBqSj8sDeUw_wNTHBbC2ohLS8IFYkCFoMZJrU09o2S5c4KOJJ4xniLD01VP9-znzxNx3hA-dZOebQkB1cnCJcDK7ZiPBuFcpRqQf1MQIeu0bJUfELu643L-exm2rnC52RK8bWQ76DqjtNNuEJ90aQVWRclQ_T9CzveWZwBf-4Hb4KFySQplpSh0XYQ-0lJS6nnXnx9EyS_Puy8NFSyzWyltr
I/flutter ( 8073): Change { currentState: LoginLoadingState(), nextState: LoginSuccessState(User is loggedin, LoginResponse(Bearer, 31535999, eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI0IiwianRpIjoiNzk1ZDMwZWMzN2VhMDEyZDU3MGY1OGYxZGY4ZDI2MzE0NmI1YmUyYmY2MDZlZGI5YTVlNTkzYzU0YTA3YjExZWQ3ZjEwYzQwYTcxZmYxYTUiLCJpYXQiOjE2NDM1NDgxMDAuODgxNjYyLCJuYmYiOjE2NDM1NDgxMDAuODgxNjY2LCJleHAiOjE2NzUwODQwOTkuMjk4OTQzLCJzdWIiOiIzIiwic2NvcGVzIjpbXX0.F-1aUkaScgyzgefcUda34MG3Mfw1b4o6iKm3xBAdfqUaekxB4DcWFxlMlg2kx6Hw0NJUI3lQrl2W3DE2cRMloNbtIKFj8pbb0krUlY6NUxo91deC7i-wE1W0J0S8Bn1QCId03THjxWKgD0xxwmAkmzyLmTbe0Kwc2L5pb9i2M53yYPYwofatAvi4QwMl60OcbSu6sNEatsKn30jREt0sLRhKIzqmHc6UvBBwu_6WzOXzwt8vno5Dicn7OLZpEEaE2KqQz_jTlpb5U4kHJHzywjpAFaiMJobKUxRlXPNzdOUrezgyZlCDDySHkzKbftwCdrhJ2ZtfXpicZ5XToNcLv-1czsOcBqSj8sDeUw_wNTHBbC2ohLS8IFYkCFoMZJrU09o2S5c4KOJJ4xniLD01VP9-znzxNx3hA-dZOebQkB1cnCJcDK7ZiPBuFcpRqQf1MQIeu0bJUfELu643L-exm2rnC52RK8bWQ76DqjtNNuEJ90aQVWRclQ_T9CzveWZwBf-4Hb4KFySQplpSh0XYQ-0lJS6nnXnx9EyS_Puy8NFSyzWyltrjeVYmSaYXsSTHtge1oMJO6w7cfKCxjgp2YUy9zah
I/flutter ( 8073): CB-SDK: : =========================================================
I/flutter ( 8073): === REQUEST ==== 689eb5c7-af11-403d-a5dd-0dd03407b0dd ===
I/flutter ( 8073): REQUEST
I/flutter ( 8073):   POST ************************************ 
I/flutter ( 8073): HEADERS
I/flutter ( 8073):   {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 2.0.9, CB-Token: }
I/flutter ( 8073): BODY
I/flutter ( 8073):   {"application_id":"5858","auth_key":"yr-LkMB82ksb9CF","nonce":"1924688376","timestamp":"1643548104","signature":"4127cdfc040a0e8172a7a21022ea48a1b67cc251","user":{"login":"bb494cacc90946cf9cdc20487626389b","email":"*****************","password":"123456"}}
I/flutter ( 8073): 
I/flutter ( 8073): CB-SDK: : *********************************************************
I/flutter ( 8073): *** RESPONSE *** 404 *** 689eb5c7-af11-403d-a5dd-0dd03407b0dd ***
I/flutter ( 8073): HEADERS
I/flutter ( 8073):   {connection: keep-alive, content-type: application/json; charset=utf-8, date: Sun, 30 Jan 2022 13:08:26 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 29, server: nginx/1.16.1}
I/flutter ( 8073): BODY
I/flutter ( 8073):   {"errors":["User not found"]}
I/flutter ( 8073): 
I/flutter ( 8073): ----------------FIREBASE CRASHLYTICS----------------
I/flutter ( 8073): type 'ResponseException' is not a subtype of type 'String'
I/flutter ( 8073): #0      _LoginScreenState._loginToCC.<anonymous closure> (package:human_quest/module/login/view/login_screen.dart:556:39)
I/flutter ( 8073): #1      _rootRunUnary (dart:async/zone.dart:1436:47)
I/flutter ( 8073): #2      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
I/flutter ( 8073): #3      _FutureListener.handleError (dart:async/future_impl.dart:178:22)
I/flutter ( 8073): #4      Future._propagateToListeners.handleError (dart:async/future_impl.dart:779:47)
I/flutter ( 8073): #5      Future._propagateToListeners (dart:async/future_impl.dart:800:13)
I/flutter ( 8073): #6      Future._completeError (dart:async/future_impl.dart:610:5)
I/flutter ( 8073): #7      Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:666:7)
I/flutter ( 8073): #8      _rootRun (dart:async/zone.dart:1428:13)
I/flutter ( 8073): #9      _CustomZone.run (dart:async/zone.dart:1328:19)
I/flutter ( 8073): #10     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
I/flutter ( 8073): #11     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
I/flutter ( 8073): #12     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
I/flutter ( 8073): #13     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
I/flutter ( 8073): ----------------------------------------------------
smtsarial commented 2 years ago

Did you find any solution for that ?

TatankaConCube commented 2 years ago

will check it today and back later

TatankaConCube commented 2 years ago

hmm... it doesn't reproduce on our side. I suppose that you try using the result from the catchError callback as a String, but in reality, there is the type ResponseException. If you need the text of error you can get it as onError.toString():

createSession(CubeUser(
          login: 'bb494cacc90946cf9cdc20487626389b', password: '123456'))
          .then((cubeUser) async {

      }).catchError((onError) {
        logTime(onError.toString());
      });
TatankaConCube commented 2 years ago

@subhangiP your error comes from this string log('login - _loginToCC --' + error);

TatankaConCube commented 2 years ago

@smtsarial do you have the same issue? if not, please specify your issue in more detailed

smtsarial commented 2 years ago

In my issue I connected to my firebase google sign in if the user didn't register the app firstly I am signing up to the user using google then I am trying to sign up to connect cube assigning uuid parameters. But It produces the same error also sometimes it doesn't produce any error. @TatankaConCube

TatankaConCube commented 2 years ago

which error do you mean I/flutter ( 8073): type 'ResponseException' is not a subtype of type 'String' or I/flutter ( 8073): {"errors":["User not found"]}? This ticket about first.

smtsarial commented 2 years ago

`User? user = await Authentication.signInWithGoogle(context: context);

      if (user != null) {
        final String uuid = Uuid().v4();
        await FirestoreHelper.getSpecificUserInfo(user.email.toString())
            .then((value) async {
          if (value.email == "") {
            //initConnectycube();
            await signUp(CubeUser(
              login: user.uid,
              email: user.email,
              fullName: user.displayName,
              password: uuid,
            )).then((cubeUser) async {
              await SharedPrefs.saveNewUser(cubeUser);
              print(cubeUser);
              Fluttertoast.showToast(msg: "cube signed up ");
              await FirestoreHelper.addNewUser().then((value){ doing adding operation to the firebase});`

My code is shown above and it produces I/flutter ( 8073): type 'ResponseException' is not a subtype of type 'String'

also I removed some catches to see exactly what is the issue. Then I found

I/flutter ( 4357): CB-SDK: : ********************************************************* I/flutter ( 4357): *** RESPONSE *** 422 *** 67527ccb-a997-417d-9522-aef79194cb64 *** I/flutter ( 4357): HEADERS I/flutter ( 4357): {connection: keep-alive, content-type: application/json; charset=utf-8, date: Tue, 24 May 2022 08:23:08 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 47, server: nginx/1.16.1} I/flutter ( 4357): BODY I/flutter ( 4357): {"errors":{"base":["Password can't be blank"]}} I/flutter ( 4357): E/flutter ( 4357): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: ResponseException: 422: {"errors":{"base":["Password can't be blank"]}}

TatankaConCube commented 2 years ago

{"errors":{"base":["Password can't be blank"]}} why it can happen? Are you sure that you create the user with the complete data?

smtsarial commented 2 years ago

yes you can see my CubeUser object with password parameter also now, I tried static values It produces the same error

TatankaConCube commented 2 years ago

but you provided only the part of the code and the part of the logs, I need the full log and the code for clarifying your issue

another note bout this string await SharedPrefs.saveNewUser(cubeUser); in this case created user doesn't contain the password and if you use it for login you will get these errors.