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

qix createBookmarkEx argument error #69

Closed
Milio-sudo opened this issue Jun 28, 2024 · 2 comments
Closed

qix createBookmarkEx argument error #69

Milio-sudo opened this issue Jun 28, 2024 · 2 comments

Comments

@Milio-sudo
Copy link

Milio-sudo commented Jun 28, 2024

Issue: Unable to Use CreateBookmarkEx Method in QIX API

Description

While using the QIX API to create bookmarks with soft patches, we are unable to use the CreateBookmarkEx method. Regardless of the parameter set in prop, the parameter actually sent by the code is always true.

Logs

Below are some logs showing what is sent by the WebSocket (the function had prop parameters):

SENT: {"delta":true,"handle":1,"method":"CreateBookmarkEx","params":[true,null],"id":45,"jsonrpc":"2.0"}
RECEIVED: {"jsonrpc":"2.0","id":45,"error":{"code":-32700,"parameter":"Unexpected JSON token","message":"JSON parse error"}}

As you can see the first parameter is replaced by true.

Investigation

I found that in the file @qlik/api/chunks/LIPAU4N5.js, the first parameter is always replaced by true (at line 9769):

createBookmark(_createBookmark, props) {
  return _createBookmark(
    merge2(
      {},
      {
        qInfo: {
          qType: "bookmark"
        },
        qMetaDef: {
          title: "",
          description: ""
        },
        creationDate: (/* @__PURE__ */ new Date()).toISOString()
      },
      props
    )
  );
},
createBookmarkEx(_createBookmarkEx, props, patchObjs) {
  return _createBookmarkEx(
    merge2(
      true,
      {
        qInfo: {
          qType: "bookmark"
        },
        qMetaDef: {
          title: "",
          description: ""
        },
        creationDate: (/* @__PURE__ */ new Date()).toISOString()
      },
      props
    ),
    patchObjs
  );
}

Solution

Setting this parameter to {} as in the regular createBookmark version resolves the issue.

Question

Is there a specific reason for this behavior in the createBookmarkEx method?

@nilzona
Copy link
Contributor

nilzona commented Jun 29, 2024

@Milio-sudo Looks like you found a bug. We will fix and release a new version.

@nilzona
Copy link
Contributor

nilzona commented Jul 3, 2024

Fixed by #70

@nilzona nilzona closed this as completed Jul 3, 2024
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