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

Live Query websocket error: "additional properties not allowed". Sending installation ID when not needed #1136

Closed
javimendezona opened this issue Apr 6, 2020 · 4 comments

Comments

@javimendezona
Copy link

Issue Description

When trying to establish a LiveQuery websocket, sometimes I get this error:

{op: "error", error: "Additional properties not allowed", code: 1, reconnect: true}

In some cases, it will try to reconnect without sending the installation ID which will allow it to connect successfully. However, sometimes it doesn't retry, in which case it just never establishes the LiveQuery connection.

I'm wondering if there's a way to prevent it from sending the installation ID and just send the applicationId and javascriptKey when creating the connection (which seems to be successful each time).

Please see this recording of what I'm seeing in the browser Network tab: https://www.loom.com/share/9f7b96eeb7f049aa8f66a24413a9d977

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : v3.6.0
    • Operating System: Unknown - Sashido
    • Hardware: Unknown - Sashido
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Sashido
  • JS SDK

    • JS SDK version: "parse": "^2.12.0",
    • Application? (Browser, Node, React-Native, etc): Browser

Logs/Trace

{op: "error", error: "Additional properties not allowed", code: 1, reconnect: true}

@dplewis
Copy link
Member

dplewis commented Apr 7, 2020

That error is a fall back for older versions of Parse Server. If you update to the latest it won’t give you an error.

Thanks for the video, it was really helpful. I would like to see a case when it doesn’t reconnect.

@javimendezona
Copy link
Author

@dplewis thanks for the response. I'm currently using a hosted Parse server on Sashido. Their latest version is 3.6 so unfortunately I don't have control over that. I'll ask them when they plan to update the the latest. Do you happen to know what version this issue was first resolved in?

@dplewis
Copy link
Member

dplewis commented Apr 7, 2020

Here is the PR for it #977

As for which version most likely 4+

As a workaround you could get the default live query client and set additionalProperties to false.

I still would like to fix the disconnect on reconnect issue.

@javimendezona
Copy link
Author

@dplewis thanks for the workaround tip. That works for me. I didn't realize you could set that value directly with the LiveQueryClient instance. It isn't totally clear in these LiveQueryClient docs . For anyone who finds this:

let LiveQueryClient = Parse.LiveQueryClient;
let client = new LiveQueryClient({
            applicationId: '',
            serverURL: '',
            javascriptKey: ''
          });
client.additionalProperties = false;
client.open();
let subscription = client.subscribe(query);

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