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

Maximum call stack size exceeded on shared pointer position #504

Closed
2 tasks done
markov00 opened this issue Dec 30, 2019 · 1 comment · Fixed by #503 or elastic/kibana#52619
Closed
2 tasks done

Maximum call stack size exceeded on shared pointer position #504

markov00 opened this issue Dec 30, 2019 · 1 comment · Fixed by #503 or elastic/kibana#52619
Labels
bug Something isn't working regression released Issue released publicly

Comments

@markov00
Copy link
Member

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
@markov00 markov00 added bug Something isn't working regression labels Dec 30, 2019
markov00 added a commit that referenced this issue Jan 2, 2020
This commit fix the issue with the recursive loop created when feeding chart with its own cursor position.

BREAKING CHANGE: The `onCursorUpdate` Settings property is changed to a more generic
`onPointerUpdate`. The same apply for the event type `CursorEvent` that is now `PointerEvent` and can assume a `PointerOverEvent` or `PointOutEvent` shape (see TS types)

fix #504
markov00 pushed a commit that referenced this issue Jan 2, 2020
# [16.0.0](v15.0.5...v16.0.0) (2020-01-02)

### Bug Fixes

* **external pointer:** avoid recursive-loops on pointer events ([#503](#503)) ([c170f0d](c170f0d)), closes [#504](#504)

### BREAKING CHANGES

* **external pointer:** The `onCursorUpdate` Settings property is changed to a more generic
`onPointerUpdate`. The same apply for the event type `CursorEvent` that is now `PointerEvent` and can assume a `PointerOverEvent` or `PointOutEvent` shape (see TS types)
@markov00
Copy link
Member Author

markov00 commented Jan 2, 2020

🎉 This issue has been resolved in version 16.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jan 2, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
# [16.0.0](elastic/elastic-charts@v15.0.5...v16.0.0) (2020-01-02)

### Bug Fixes

* **external pointer:** avoid recursive-loops on pointer events ([opensearch-project#503](elastic/elastic-charts#503)) ([8f9c258](elastic/elastic-charts@8f9c258)), closes [opensearch-project#504](elastic/elastic-charts#504)

### BREAKING CHANGES

* **external pointer:** The `onCursorUpdate` Settings property is changed to a more generic
`onPointerUpdate`. The same apply for the event type `CursorEvent` that is now `PointerEvent` and can assume a `PointerOverEvent` or `PointOutEvent` shape (see TS types)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression released Issue released publicly
Projects
None yet
1 participant