Skip to content

"Awesome" study returns corrupted JSON with JS function instead of study name (Flutter) #20

@kuldeep-IT

Description

@kuldeep-IT
Image

=> When adding the Awesome study from ChartIQ in Flutter, the backend returns invalid JSON in the active studies list.
Instead of the correct study name, the inputs.display and name fields contain a full JavaScript function (String.prototype.capitalize() deprecation log).

Expected Behavior

The active study list should return clean and valid JSON for the Awesome study, similar to ATR.

Example (expected):

{
  "name": "Awesome Oscillator",
  "shortName": "Awesome",
  "type": "Awesome",
  "inputs": { "display": "Awesome (14)" },
  "outputs": { "Decreasing Bar": "#FF0000", "Increasing Bar": "#00DD00" },
  "overlay": false
}

Actual Behavior
Received corrupted JSON with JavaScript code embedded in inputs.display, name, and shortName:

{
  "name": "Awesome (function () { log(\"String.prototype.capitalize() has been deprecated...); return CIQ.capitalize(this); })",
  "inputs": {
    "display": "Awesome (function () { log(\"String.prototype.capitalize() has been deprecated...); return CIQ.capitalize(this); })"
  },
  "outputs": {
    "Decreasing Bar": "#FF0000",
    "Increasing Bar": "#00DD00"
  },
  "overlay": false
}

Steps to Reproduce

  • Open Flutter app with ChartIQ integrated.
  • Add Awesome study from the study list.
  • Call getActiveStudies() from Flutter.
  • Observe corrupted JSON in logs.

Logs:

I/flutter ( 8764): ChartIQStudyImpl getActiveStudies JSON => [
 {attributes: {}, ..., name: ATR (14), type: ATR, ...},
 {attributes: {}, ..., name: Awesome (function () { log("String.prototype.capitalize() has been deprecated.  Use CIQ.capitalize(string) instead."); return CIQ.capitalize(this); }), type: Awesome, ... }
]

Environment

Flutter version: 3.27.4
ChartIQ Flutter SDK version: 0.0.19
Platform: Android/iOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions