Skip to content

Maximum call stack size exceeded on shared pointer position #504

@markov00

Description

@markov00

Describe the bug
When sharing the pointer position between multiple charts, if the consumer feed-back the event to the source chart, an error will occur and the a Maximum call stack size exceeded error is thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Playground
  2. Copy and paste the following:
Code ```tsx import React from 'react'; import { Chart, Settings, TooltipType, AreaSeries, PointerEvent } from '../src'; import { KIBANA_METRICS } from '../src/utils/data_samples/test_dataset_kibana'; export class Playground extends React.Component { chartRef: React.RefObject = React.createRef(); chartRef2: React.RefObject = React.createRef(); onPointerUpdate = (event: PointerEvent) => { if (this.chartRef && this.chartRef.current) { this.chartRef.current.dispatchExternalPointerEvent(event); } if (this.chartRef2 && this.chartRef2.current) { this.chartRef2.current.dispatchExternalPointerEvent(event); } }; render() { return ( <> Snapshot
); } } ```
  1. Move the mouse over one chart and see the error on console

Expected behavior
No error thrown, the event should be ignored by the chart that emit it

Screenshots
n/a

Version (please complete the following information):

  • Elastic Charts: from 15.x

Additional context
On version 14 there was a mechanism to avoid this feedback loop

Errors in browser console

"RangeError: Maximum call stack size exceeded
    at eval (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/reselect/lib/index.js?:80:37)
    at eval (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/reselect/lib/index.js?:36:25)
    at selector (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/re-reselect/dist/index.js?:104:32)
    at eval (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/reselect/lib/index.js?:86:37)
    at eval (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/reselect/lib/index.js?:36:25)
    at selector (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/re-reselect/dist/index.js?:104:32)
    at eval (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/reselect/lib/index.js?:86:37)
    at eval (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/reselect/lib/index.js?:36:25)
    at selector (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/re-reselect/dist/index.js?:104:32)
    at eval (webpack://%5Bname%5D/./node_modules/@elastic/charts/node_modules/reselect/lib/index.js?:86:37)"

Kibana Cross Issues
n/a

Checklist

  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionreleasedIssue released publicly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions