Skip to content

Cannot GET /parse/classes/TestObjectForApi #52

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

Closed
erickvasilev opened this issue Jan 22, 2019 · 4 comments
Closed

Cannot GET /parse/classes/TestObjectForApi #52

erickvasilev opened this issue Jan 22, 2019 · 4 comments

Comments

@erickvasilev
Copy link

Hi, I just download example from your Repo, and update the application_constant.dart with my own configuration.

I run several test, but fail on Query():
healthcheck(); --> Passed
createItem(); --> Passed
query(); --> Fail

Reloaded 1 of 573 libraries in 4,582ms.
I/flutter (18233):
I/flutter (18233): ----
I/flutter (18233): API Response (ParseMain : ParseApiRQ.healthCheck) :
I/flutter (18233): Status Code: 200
I/flutter (18233): Payload: {status: ok}
I/flutter (18233): ----
I/flutter (18233):
I/flutter (18233): ----
I/flutter (18233): API Response (TestObjectForApi : ParseApiRQ.create) :
I/flutter (18233): Status Code: 201
I/flutter (18233): Payload: {"className":"className","objectId":"SceXYhHck2","createdAt":"2019-01-22T09:07:22.660Z"}
I/flutter (18233): ----
I/flutter (18233): app02: {"className":"className","objectId":"SceXYhHck2","createdAt":"2019-01-22T09:07:22.660Z"}
I/Choreographer(18233): Skipped 31 frames!  The application may be doing too much work on its main thread.
Reloaded 1 of 573 libraries in 4,748ms. //Change the runTestQueries() action from createItem() to query()
I/flutter (18233): start response
I/flutter (18233): Cannot GET /parse/classes/TestObjectForApi?where=%7B%7D
I/flutter (18233): Instance of 'Response'
I/flutter (18233): Instance of 'ParseResponse'
I/flutter (18233): end response
I/flutter (18233):
I/flutter (18233): ----
I/flutter (18233): API Response (TestObjectForApi : ParseApiRQ.query) :
I/flutter (18233): Status Code: -1
I/flutter (18233): Type: UnknownError
I/flutter (18233): Exception: FormatException: Unexpected character (at character 1)
I/flutter (18233): Cannot GET /parse/classes/TestObjectForApi?where=%7B%7D
I/flutter (18233): ^
I/flutter (18233):
I/flutter (18233): ----
I/flutter (18233): Result: FormatException: Unexpected character (at character 1)
I/flutter (18233): Cannot GET /parse/classes/TestObjectForApi?where=%7B%7D
I/flutter (18233): ^

I've check the "TestObjectForApi" classes permission, all is write-able and get-able, and I'm successfully fetch the created Objects from Postman.

void query() async {
    var queryBuilder = QueryBuilder<ParseObject>(ParseObject('TestObjectForApi'));
    //  ..setLimit(10)  
    //  ..includeObject(['Day']);

    var apiResponse = await queryBuilder.query();

    if (apiResponse.success && apiResponse.result != null) {
      print("Result: ${((apiResponse.result as List<dynamic>).first as ParseObject).toString()}");
    } else {
      print("Result: ${apiResponse.error.message}");
    }
  }

Thanks.

@phillwiggins
Copy link
Member

I've not seen this issue before. Potentially, what could be happening is that your app is actually crashing somewhere here:-

I/Choreographer(18233): Skipped 31 frames!  The application may be doing too much work on its main thread.
Reloaded 1 of 573 libraries in 4,748ms. //Change the runTestQueries() action from createItem() to query()

Due to this, the class that holds all your server details is actually a singleton class and could be getting wiped, hence going forward, nothing works. Is your device low on memory or anything along those lines? We might have to add some persistent storage for all the Parse Server data?

@erickvasilev
Copy link
Author

erickvasilev commented Jan 22, 2019

Before the healthCheck() and createItem();, I see the "Skipped frames" notice too. But after that line, the healthCheck() and createItem() successfully triggered.

This time, I skipped the healthCheck(); and run the Query() directly, just to make sure the function isn't loose the keyParseServerUrl data while running.

initParse() async {
    // Initialize parse
    Parse().initialize(
        ApplicationConstants.keyParseApplicationId,
        ApplicationConstants.keyParseServerUrl,
        masterKey: ApplicationConstants.keyParseMasterKey,
        debug: true);

     runTestQueries();
    // Check server is healthy and live - Debug is on in this instance so check logs for result
   // var response = await Parse().healthCheck();
   // if (response.success){
     
   // } else {
    //  print("Server health check failed");
    //}
  }

  runTestQueries() {
    //createItem();
    //getAllItems();
    //getAllItemsByName();
    //getSingleItem();
    query();
    //function();
    //initUser();
  }

This is my full debug console information:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Built build\app\outputs\apk\debug\app-debug.apk.
I/Choreographer(18451): Skipped 135 frames!  The application may be doing too much work on its main thread.
D/EGL_emulation(18451): eglMakeCurrent: 0xe2805ba0: ver 3 0 (tinfo 0xe2803f90)
I/OpenGLRenderer(18451): Davey! duration=3043ms; Flags=1, IntendedVsync=69981104215194, Vsync=69983354215104, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=69983360905440, AnimationStart=69983361051540, PerformTraversalsStart=69983365155840, DrawStart=69983430625840, SyncQueued=69983435607040, SyncStart=69983437480240, IssueDrawCommandsStart=69983437784640, SwapBuffers=69983701248740, FrameCompleted=69984149545940, DequeueBufferDuration=49539000, QueueBufferDuration=1154000,
D/        (18451): HostConnection::get() New Host Connection established 0xe28eebc0, tid 18473
D/EGL_emulation(18451): eglMakeCurrent: 0xe28ace20: ver 3 0 (tinfo 0xe106ff90)
I/flutter (18451): start response
I/flutter (18451): Cannot GET /parse/classes/TestObjectForApi?where=%7B%7D
I/flutter (18451): Instance of 'Response'
I/flutter (18451): Instance of 'ParseResponse'
I/flutter (18451): end response
I/flutter (18451):
I/flutter (18451): ----
I/flutter (18451): API Response (TestObjectForApi : ParseApiRQ.query) :
I/flutter (18451): Status Code: -1
I/flutter (18451): Type: UnknownError
I/flutter (18451): Exception: FormatException: Unexpected character (at character 1)
I/flutter (18451): Cannot GET /parse/classes/TestObjectForApi?where=%7B%7D
I/flutter (18451): ^
I/flutter (18451):
I/flutter (18451): ----
I/flutter (18451): Result: FormatException: Unexpected character (at character 1)
I/flutter (18451): Cannot GET /parse/classes/TestObjectForApi?where=%7B%7D
I/flutter (18451): ^
I/Choreographer(18451): Skipped 32 frames!  The application may be doing too much work on its main thread.
I/OpenGLRenderer(18451): Davey! duration=1357ms; Flags=0, IntendedVsync=70003942698546, Vsync=70003959365212, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=70003975495140, AnimationStart=70003975999240, PerformTraversalsStart=70004047694240, DrawStart=70004050773240, SyncQueued=70004051349440, SyncStart=70004326677440, IssueDrawCommandsStart=70004522646940, SwapBuffers=70005205103640, FrameCompleted=70005575346740, DequeueBufferDuration=1130000, QueueBufferDuration=848000,
I/Choreographer(18451): Skipped 62 frames!  The application may be doing too much work on its main thread.
I/OpenGLRenderer(18451): Davey! duration=759ms; Flags=0, IntendedVsync=70003982360679, Vsync=70004515693991, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=70004527253340, AnimationStart=70004527641740, PerformTraversalsStart=70004537419640, DrawStart=70004590658340, SyncQueued=70004594725740, SyncStart=70005575817240, IssueDrawCommandsStart=70005576050340, SwapBuffers=70005579581540, FrameCompleted=70005722685840, DequeueBufferDuration=39301000, QueueBufferDuration=29924000,

Flutter Version: 1.1.10-pre.136
Device: AVD emulator from Android Studio

If you can't reproduce the error, you may right about the device issue. I'll try with another device.

Thanks for your response.

@phillwiggins
Copy link
Member

phillwiggins commented Jan 22, 2019 via email

@phillwiggins
Copy link
Member

Closing due to inacitivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants