Skip to content

[BUG] EditorResponse<null> resolves to an empty string #615

@seancrowe

Description

@seancrowe

Description
It appears that several functions, which are documented to return Promise<EditorResponse<null>>, are instead returning and empty string in their parsedData. This inconsistency affects functions such as:

  • SDK.layout.setPrivateData
  • SDK.variable.rename
  • SDK.canvas.setZoomPercentage

But there are more.

Steps to Reproduce

  1. Call any of the functions listed above.
  2. Observe the response object, specifically the parsedData field.
  3. Note that parsedData is not of type null as expected.

Expected Behavior
According to the EditorResponse interface, the expected structure is:

interface EditorResponse<T> {
  data?: null | string;
  error?: null | string;
  parsedData: null | T;
  status: number;
  success: boolean;
}

For functions like setPrivateData, which should return Promise<EditorResponse<null>>, the parsedData should be null. The documentation for setPrivateData can be found here.

Actual Behavior
The parsedData field is returning an empty string, not null, contrary to the documented return type.

MAIN Ticket

https://chilipublishintranet.atlassian.net/browse/MAIN-1414

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions