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

type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'ParseBase' #42

Closed
jellyninjadev opened this issue Jan 20, 2019 · 18 comments

Comments

@jellyninjadev
Copy link

Steps to reproduce

  • open example from repository
  • run

Description

It seems like on the request for health check, when response is returned it crashes on the response.result = _handleSingleResult<T>(object, map); line. I am not familiar enough with flutter and parse sdk to figure out the problem on my own yet.

@phillwiggins
Copy link
Member

phillwiggins commented Jan 20, 2019 via email

@phillwiggins
Copy link
Member

phillwiggins commented Jan 20, 2019 via email

@jellyninjadev
Copy link
Author

jellyninjadev commented Jan 20, 2019

Hey @phillwiggins that's for quick response.
My flutter version

Flutter 1.1.10-pre.78 • channel master • https://github.com/flutter/flutter.git
Framework • revision 105026cd68 (4 days ago) • 2019-01-16 08:13:00 -0800
Engine • revision 09e149e897
Tools • Dart 2.1.1 (build 2.1.1-dev.1.0 2195a70249)

I have this configuration inside ApplicationConstantsts

abstract class ApplicationConstants {
  static const String keyAppName = "";
  static const String keyParseApplicationId = "test";
  static const String keyParseMasterKey = "key";
  static const String keyParseServerUrl = "http://localhost:1337/parse";
}

and I run my parse-server with this command: parse-server --appId test --masterKey key --databaseURI mongodb://localhost/project-name

I just run from examples folder, so I guess my library version is master.

@phillwiggins
Copy link
Member

phillwiggins commented Jan 20, 2019 via email

@erickvasilev
Copy link

erickvasilev commented Jan 21, 2019

image

I got this error after init:
var response = await Parse().healthCheck();

image

parse_server_sdk: ^1.0.8

My Parse server is configured correctly and running, I'm using it for my Web App.

@cetorres
Copy link

cetorres commented Jan 21, 2019

Same thing here. I was using version 1.0.5 and It was working. Now it fails on the first request to the Parse server, in my case, healthCheck() as well.
I cannot even start my app. Please fix it asap.
Thank you.

@phillwiggins
Copy link
Member

phillwiggins commented Jan 21, 2019 via email

@phillwiggins
Copy link
Member

Sorry, just for reference, can you breakpoint before the exception. In really curious as to the contents of the response but won't be in from of a computer until this afternoon. Thanks in advance.

@cetorres
Copy link

cetorres commented Jan 21, 2019

It fails in any request. Healthcheck just happened to be the first. But commented out and it fails on next request, a query.
Thank you for the attention!

@phillwiggins
Copy link
Member

phillwiggins commented Jan 21, 2019 via email

@erickvasilev
Copy link

Hi, not sure how to add a breakpoint in Flutter, but the server response is {status: ok}

image

@phillwiggins
Copy link
Member

Okay cool. Thanks.

I can see the issue and will fix later today when I am able to. Is it possible to break point line 25 of parse_response.dart. It looks as though some builds of ParseServer will response with the apiResponse.body being "OK"... As this is not happening it's trying to handle the result as if it's a ParseObject, or some extension of. I would be keep to see the response. Assuming it's just the case that some ParseServer builds might respond with "ok" in which case it's not being caught correctly. Although this wouldn't explain why some queries after are not working.

Thanks in advance.

@ghost
Copy link

ghost commented Jan 21, 2019

@phillwiggins
Copy link
Member

Thanks @scaneat . That did help... left me with more questions though. Seems as though the response isn't being handled correctly.

I've created a new branch called release/1.0.9. If anybody is able to pull that and add it to their project to confirm the fix.

Is everybody else having issues with more than just the healthCheck request? Again, it's not a necessary check for the app. But will be fixed in the next release.

@ghost
Copy link

ghost commented Jan 21, 2019

Parse().healthCheck() works now with 1.0.9.

In main.dart, I decomment all calls in runTestQueries() : in initUser() there are still 2 littles issues in main.dart that I solved with this sample.

// Returns type ParseResponse as its a query, not a single result
    response = await ParseUser.all();
    if (response.success) user = (response.result as List<dynamic>).first as ParseUser; //(ISSUE) response.result;

    var queryBuilder = QueryBuilder<ParseUser>(ParseUser.forQuery())
      ..whereStartsWith(ParseUser.keyUsername, 'phillw');

    var apiResponse = await queryBuilder.query();
    if (apiResponse.success) user = (response.result as List<dynamic>).first as ParseUser; //(ISSUE) response.result;

@phillwiggins
Copy link
Member

Perfect, I'll do some regression testing later and create an official 1.0.9 fix. Thanks for testing.

@scaneat Do you want to create a pull request with your fixes? Or shall I add them to the release later?

@ghost
Copy link

ghost commented Jan 21, 2019

Mmm, I prefer you do it because I don't feel comfortable with that.

@phillwiggins
Copy link
Member

Fixed in 1.0.9

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

4 participants