Skip to content

fix(LiveQuery): Session token null when subscribing #228

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

Conversation

douglasmuraoka
Copy link
Contributor

When autoSendSessionId: true, it always sets the sessionToken header, even if null. However, when null, it throws an exception due to its unexpected type and breaks live query.

Below is the Flutter output when this happens:

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}

Fixes #196

When `autoSendSessionId: true`, it always sets the sessionToken header, even if `null`. However, when `null`, it throws an exception due to its unexpected type and breaks live query.

```
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}
```
@phillwiggins phillwiggins merged commit 0cffb99 into parse-community:release/1.0.23 Jul 25, 2019
fischerscode pushed a commit to fischerscode/Parse-SDK-Flutter that referenced this pull request Sep 5, 2020
)

When `autoSendSessionId: true`, it always sets the sessionToken header, even if `null`. However, when `null`, it throws an exception due to its unexpected type and breaks live query.

```
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}
```
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

Successfully merging this pull request may close these issues.

2 participants