wevisdemo / parliament-watch

Citizens are watching 👀
https://parliamentwatch.wevis.info
46 stars 26 forks source link

Half donut chart in section is frozen #86

Closed petchill closed 2 weeks ago

petchill commented 1 month ago

Describe the bug Half donut chart in section นักการเมือง is frozen

To Reproduce Steps to reproduce the behavior:

  1. Go to https://parliamentwatch.wevis.info/assemblies/%E0%B8%AA%E0%B8%A0%E0%B8%B2%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%81%E0%B8%97%E0%B8%99%E0%B8%A3%E0%B8%B2%E0%B8%A9%E0%B8%8E%E0%B8%A3-25
  2. click angle right icon to change data set
  3. see at chart, it will not changed

Expected behavior It should be changed related to data set

Screenshots this is first time

image

this is after I change data set

image

you can see chart is frozen even though data in right section is changed.

Desktop (please complete the following information):

Th1nkK1D commented 1 month ago

If I understand correctly, this bug only exists on the dev server (SSR) but not on the staging (SSG).

I think there is some variable, or function in the component that depends on the props but doesn't "reactive" (prefix with$:) so when we change the page on SSR the value was calculated once since SvelteKit will render only what it thinks necessary, but on SSG it's working fine because it is a full reload on different page.

For anyone who wants to fix this, the solution would be to turn those variables/function that depends on props to be reactive. Read more about Svelte's reactivity declaration

EDIT: OK This bug appears on production as well. Look like SvelteKit doesn't use full reload even on SSG.

Th1nkK1D commented 2 weeks ago

Fixed in #91 but needs some time to be merged to main and deployed.