-
-
Notifications
You must be signed in to change notification settings - Fork 206
live error #196
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
Comments
Hey,
Add 'await' before Parse.initialize.
I think that might fix it.
…On Sat, Jun 15, 2019, 16:46 子非鱼 ***@***.***> wrote:
*** error info ***
I/flutter (12537): LiveQuery: : ConnectMessage: {op: connect,
applicationId: myAppId, masterKey: 123456, sessionToken: null}
I/flutter (12537): LiveQuery: : SubscribeMessage: {op: subscribe,
requestId: 1, query: {className: Diet_Plans, where: {objectId:
2pNUgv1CKA}}, sessionToken: null}
I/flutter (12537): LiveQuery: : Listen: {"op":"error","error":"Invalid
type: null (expected string)","code":1,"reconnect":true}
`Future initData() async {
// Initialize parse
Parse().initialize(
keyParseApplicationId,
keyParseServerUrl,
masterKey: keyParseMasterKey,
debug: true,
liveQueryUrl: keyParseLiveServerUrl,
);
final ParseResponse response = await Parse().healthCheck();
if (response.success) {
await _listen();
}
}`
`Future _listen() async {
QueryBuilder query = QueryBuilder(DietPlan())
..whereEqualTo('objectId', '2pNUgv1CKA');
LiveQuery liveQuery = LiveQuery();
// print("=====query: $query");
await liveQuery.subscribe(query);
liveQuery.on(LiveQueryEvent.update, (dynamic value) {
print('*** UPDATE ***: ${DateTime.now().toString()}\n $value');
print((value as ParseObject).objectId);
print((value as ParseObject).updatedAt);
print((value as ParseObject).createdAt);
// print((value as ParseObject).get('objectId'));
// print((value as ParseObject).get('updatedAt'));
// print((value as ParseObject).get('createdAt'));
print("data:" + (value as ParseObject).toJson().toString());
// _result.add(value);
});
}`
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#196>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB4CPXVZZZL2VGWMEX4K7OLP2UFEBANCNFSM4HYPJHGQ>
.
|
no effect parse server v2.7.1 parse live config: |
@unreal0 Just set |
websoket ok!!! thanks
flutter log |
If you don't want to send session id while init the Parse SDK, you can send it during init LiveQuery instance. |
@zenz _sendSessionId = autoSendSessionId ?? ParseCoreData().autoSendSessionId;
.....
//The connect message is sent from a client to the LiveQuery server.
//It should be the first message sent from a client after the WebSocket connection is established.
_connectMessage = <String, String>{
'op': 'connect',
'applicationId': _client.data.applicationId,
'clientKey': _client.data.clientKey ?? ''
};
if (_sendSessionId) {
_connectMessage['sessionToken'] = _client.data.sessionId;
} |
how to config bloc connect to live stream? |
Make sure your initialization code completes before performing any request to the server. Execute live query code in "then"
|
There's not been much movement on this recently. Are we safe to close? |
*** error info ***
I/flutter (12537): LiveQuery: : ConnectMessage: {op: connect, applicationId: myAppId, masterKey: 123456, sessionToken: null}
I/flutter (12537): LiveQuery: : SubscribeMessage: {op: subscribe, requestId: 1, query: {className: Diet_Plans, where: {objectId: 2pNUgv1CKA}}, sessionToken: null}
I/flutter (12537): LiveQuery: : Listen: {"op":"error","error":"Invalid type: null (expected string)","code":1,"reconnect":true}
*** server log info***
2019-06-15T16:11:53.624Z - Connect message error Invalid type: null (expected string) 2019-06-15T16:11:53.623Z - Connect message error Invalid type: null (expected string) 2019-06-15T16:11:50.911Z - Can not find client undefined on disconnect 2019-06-15T16:11:35.270Z - Connect message error Invalid type: null (expected string) 2019-06-15T16:11:35.268Z - Connect message error Invalid type: null (expected string) 2019-06-15T16:11:32.126Z - Can not find client undefined on disconnect 2019-06-15T16:11:32.125Z - Client disconnect: undefined
code
`Future initData() async {
}`
`Future _listen() async {
QueryBuilder query = QueryBuilder(DietPlan())
..whereEqualTo('objectId', '2pNUgv1CKA');
LiveQuery liveQuery = LiveQuery();
// print("=====query: $query");
await liveQuery.subscribe(query);
}`
The text was updated successfully, but these errors were encountered: