Skip to content

Fix chart lifecycle issues - #134

Open
narenknn wants to merge 1 commit into
project-nv:mainfrom
narenknn:codex/fix-chart-lifecycle
Open

narenknn wants to merge 1 commit into
project-nv:mainfrom
narenknn:codex/fix-chart-lifecycle

Conversation

@narenknn

Copy link
Copy Markdown
  1. SeClient assumed chart.ww always existed
    In night-vision/src/core/se/seClient.js, the constructor did this.ww = chart.ww unconditionally. But DataHub can request SeClient.instance(id) before the full chart object is attached, which caused the runtime crash:
    Cannot read properties of undefined (reading 'ww')

Fix:

  • make SeClient tolerate missing chart
  • hydrate the existing singleton later when the real chart arrives
  1. showLogo setter wrote to the wrong field
    In night-vision/src/interface.js, the setter was:
set showLogo(val) {
    this.comp.$set({id: val})
}

So changing showLogo actually overwrote the component id, which is a real bug and can corrupt internal chart identity/state.

Fix:

  • change it to this.comp.$set({showLogo: val})
  1. MetaHub.finish() triggered an unsafe deferred layout refresh
    In night-vision/src/core/metaHub.js, finish() did a delayed:
  • update-layout
  • update-legend

That extra deferred refresh could run while the chart was still between data/layout states, which contributed to crashes like:

  • Cannot read properties of undefined (reading '0')
  • Cannot read properties of undefined (reading 'Candles')

Fix:

  • stop emitting that deferred refresh from finish()
  • let normal chart lifecycle updates drive layout instead

@netlify

netlify Bot commented Apr 22, 2026

Copy link
Copy Markdown

Deploy Preview for shiny-selkie-5e063f canceled.

Name Link
🔨 Latest commit f8803f4
🔍 Latest deploy log https://app.netlify.com/projects/shiny-selkie-5e063f/deploys/69e8d34a824dd7000830960b

@narenknn

Copy link
Copy Markdown
Author

Hi .. can any maintainer pull in this ??

@Klemencina

Copy link
Copy Markdown

its been a bit since any maintainer was active

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

Successfully merging this pull request may close these issues.

2 participants