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

SDK Parse 1.0.26 not usable - boolean expression must not be null #371

Closed
jeansebastienZ opened this issue May 11, 2020 · 17 comments
Closed

Comments

@jeansebastienZ
Copy link

jeansebastienZ commented May 11, 2020

Hi,

I'm making a new topic , as the old one get no answer and it still problematic in order to use the last SDK .
Issue on Android

  1. Create a new project
  2. Basic initialisation :
 Parse().initialize(
        MyParse.applicationId,
        MyParse.serverURL,
        masterKey: masterKey,
        clientKey: clientKey,
        debug: true,
        liveQueryUrl: liveQueryUrl,
        autoSendSessionId: true);

3)[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: Failed assertion: boolean expression must not be null

Where is the problem ? seem to refer to :
ParseHTTPClient.send (package:parse_server_sdk/src/network/parse_http_client.dart:40:14)

Using parse_server_sdk: 1.0.21 with the same code , works perfectly . However 1.0.21 is not usable if you need parse live query and subscription.

Can you try to dig and find out whats the problem please ?

@phillwiggins
Copy link
Member

phillwiggins commented May 11, 2020 via email

@jeansebastienZ
Copy link
Author

Hello,

It is on the health check when the app start :

  Parse().initialize(
        MyParse.applicationId,
        MyParse.serverURL,
        masterKey: masterKey,
        clientKey: clientKey,
        debug: true,
        liveQueryUrl: liveQueryUrl,
        autoSendSessionId: true);

    final ParseResponse response = await Parse().healthCheck(); 

@phillwiggins
Copy link
Member

phillwiggins commented May 11, 2020 via email

@phillwiggins
Copy link
Member

phillwiggins commented May 11, 2020 via email

@jeansebastienZ
Copy link
Author

jeansebastienZ commented May 11, 2020

I post all my dependencies, if something is interfering, don't know :

http: ^0.12.0+4
shared_preferences: 0.5.7+1
connectivity: ^0.4.8+5
web_socket_channel: ^1.1.0
parse_server_sdk: 1.0.26

I would not find out the problem was a version related if #282 did not get the same problem .

here the full logs showing the issue:

E/flutter (25205): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: Failed assertion: boolean expression must not be null
E/flutter (25205): #0 ParseHTTPClient.send (package:parse_server_sdk/src/network/parse_http_client.dart:40:14)
E/flutter (25205): #1 BaseClient._sendUnstreamed (package:http/src/base_client.dart:176:38)
E/flutter (25205): #2 BaseClient.get (package:http/src/base_client.dart:35:7)
E/flutter (25205): #3 Parse.healthCheck (package:parse_server_sdk/parse_server_sdk.dart:161:25)
E/flutter (25205): #4 MyParse.initParseLive (package:easy/Parse/MyParse.dart:62:50)
E/flutter (25205): #5 homeusersstate.initState (package:easy/client/homeusers.dart:38:13)
E/flutter (25205): #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4644:58)
E/flutter (25205): #7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4480:5)
E/flutter (25205): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #10 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5834:14)
E/flutter (25205): #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4531:16)
E/flutter (25205): #14 Element.rebuild (package:flutter/src/widgets/framework.dart:4222:5)
E/flutter (25205): #15 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4485:5)
E/flutter (25205): #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4480:5)
E/flutter (25205): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #19 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5834:14)
E/flutter (25205): #20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #21 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #22 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5834:14)
E/flutter (25205): #23 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #24 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #25 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4531:16)
E/flutter (25205): #26 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4679:11)
E/flutter (25205): #27 Element.rebuild (package:flutter/src/widgets/framework.dart:4222:5)
E/flutter (25205): #28 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4485:5)
E/flutter (25205): #29 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4670:11)
E/flutter (25205): #30 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4480:5)
E/flutter (25205): #31 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #32 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #33 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5834:14)
E/flutter (25205): #34 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #35 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #36 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5834:14)
E/flutter (25205): #37 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #38 Element.updateChild (package:flutter/src/widgets/framework.dart:3218:18)
E/flutter (25205): #39 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4531:16)
E/flutter (25205): #40 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4679:11)
E/flutter (25205): #41 Element.rebuild (package:flutter/src/widgets/framework.dart:4222:5)
E/flutter (25205): #42 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4485:5)
E/flutter (25205): #43 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4670:11)
E/flutter (25205): #44 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4480:5)
E/flutter (25205): #45 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3450:14)
E/flutter (25205): #46 Element.updateChild

@phillwiggins
Copy link
Member

Very strange. I cannot replicate this issue.

Can you try adding a persistant storage option?

coreStore: await CoreStoreSembastImp.getInstance()

Add this to the Parse.initialize() method?

@jeansebastienZ
Copy link
Author

Hello Phill ,

Parse().initialize(
MyParse.applicationId,
MyParse.serverURL,
masterKey: masterKey,
clientKey: clientKey,
debug: true,
liveQueryUrl: liveQueryUrl,
autoSendSessionId: true,
coreStore: await CoreStoreSembastImp.getInstance());

Works , can you explain me why ? I trie on a new project and on my old , and for both with CoreStoreSembastImp.getInstance() it work . Thanks you for this , if you think you know why let me know then i'll close this one .

@phillwiggins
Copy link
Member

phillwiggins commented May 11, 2020 via email

@fischerscode
Copy link
Contributor

Inside parse_core_data.dart a default CoreStore should be set.

    _instance.storage ??=
        store ?? await CoreStoreSharedPrefsImp.getInstance(password: masterKey);

@jeansebastienZ
Copy link
Author

Ok indeed i see , should be corrected for future users , basically , i didn't expect you to answer that fast , so thanks , you saved my day . Send paypal i'll make a small donation . Have a nice day .

@phillwiggins
Copy link
Member

phillwiggins commented May 11, 2020 via email

@fischerscode
Copy link
Contributor

@phillwiggins
This is just an idea:
The password for the default CoreStore is masterKey. And masterKey should be null in every published app. This might cause the assertion to fail.
I have not tested it, but it might be better to use the password 'flutter_sdk'. As this one is used inside the getInstance block as a default.

@phillwiggins
Copy link
Member

phillwiggins commented May 12, 2020 via email

@fischerscode
Copy link
Contributor

Unfortunately I have at the moment no time to give this a try. I will do so in several hours.
If this fixes the issue, it should be a good solution.
Additionally we should encourage programmers to use a custom and random password. By telling them in the Readme. As a default password is never the best solution and it is easy to miss.

@gorillatapstudio
Copy link

In my case, when testing web app on chrome, it seems it shows different results as above.
1.0.23 works for parse.initialize(sharedpreference) and user.signup()
1.0.26 works for parse.initialize(sharedpreference) but user.signup() shows boolean null exception
as suggested by the post, i tested using CoreStoreSembastImp
1.0.26 parse.initalize(sembast) already shows boolean null exception.

@fischerscode
Copy link
Contributor

@phillwiggins
I finally found time to test my ideas described in #371 (comment).
Using masterKeyas a the default password does not seem to be an issue, as the the CoreStoreSharedPrefsImpdoes not even use the password provided in the getInstance() call.

I was not able to reproduce the issue using the example_livelist (there is no CoreStore specified in the Parse().initialize). (Tested on the android emulator)

@phillwiggins
Copy link
Member

It's a logical idea. It's strange that a crash is happening in this other issue.

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