encointer / explorer

explore the encointer network, browse local communitities an monitor populations
GNU General Public License v3.0
1 stars 1 forks source link

crash when selecting a community-aggregate blob in global view #115

Closed brenzi closed 1 year ago

brenzi commented 1 year ago

On Gesell and Kusama, this happened:

https://explorer.encointer.org/?rpc=wss%3A%2F%2Fgesell.encointer.org

  1. click on any aggregation blob (aggregating more than one community, i.e. in Berlin)
  2. crash
react-dom.production.min.js:216 TypeError: Cannot destructure property 'coords' of 'e.data' as it is undefined.
    at TI (LocationsLayer.js:40:11)
    at sa (react-dom.production.min.js:157:137)
    at Gs (react-dom.production.min.js:267:460)
    at Ou (react-dom.production.min.js:250:347)
    at Eu (react-dom.production.min.js:250:278)
    at Cu (react-dom.production.min.js:250:138)
    at bu (react-dom.production.min.js:243:163)
    at react-dom.production.min.js:123:115
    at t.unstable_runWithPriority (scheduler.production.min.js:18:343)
    at Wi (react-dom.production.min.js:122:325)
cs @ react-dom.production.min.js:216
react-dom.production.min.js:123 Uncaught TypeError: Cannot destructure property 'coords' of 'e.data' as it is undefined.
    at TI (LocationsLayer.js:40:11)
    at sa (react-dom.production.min.js:157:137)
    at Gs (react-dom.production.min.js:267:460)
    at Ou (react-dom.production.min.js:250:347)
    at Eu (react-dom.production.min.js:250:278)
    at Cu (react-dom.production.min.js:250:138)
    at bu (react-dom.production.min.js:243:163)
    at react-dom.production.min.js:123:115
    at t.unstable_runWithPriority (scheduler.production.min.js:18:343)
    at Wi (react-dom.production.min.js:122:325)
Quackaholic-Quacktivity commented 1 year ago

image

weird... I don't get this error. Could it be a cache issue?

brenzi commented 1 year ago

no cache issue. it only happens if you click on aggregation blobs

Quackaholic-Quacktivity commented 1 year ago

Ok. I might have finally found the reason for this Problem, but I'm still working on how to fix the issue. The Problem described above comes from that cid and ui.selected aren't a CID when clicking on a community cluster, but something called a Marker. I then realized that they don't store an Object called Marker but a String called "Marker". I then had to Dig even deeper to find out where this is happening and right now my theory is that the onClick event handler of the CommunitiesClusters component in Map.js gives us a String when you press the CommunitiesCluster. Thinking it might happen with all the onClick event handlers I tried with a Button, but there the thing you get is an Object. I then dug even deeper trying to find out why it's doing that and found that the event type of the onClick event handler of the CommunitiesClusters component, type Leaflet.LeafletMouseEvent is.
I then found out that LeafletMouseEvent extends another Component called LeafletEvent which has type String. So LeafletEvent has typeString. But here lies the Problem. I cannot overwrite these interfaces as I think they are JS native. Will look into it on how I can solve this Problem.

brenzi commented 1 year ago

As this has worked before, I suggest you focus your investigation on the most recent changes

Quackaholic-Quacktivity commented 1 year ago

image I still haven't found the Problem, as I looked if I ever modified something that could explain the Problem and found nothing. But I keep getting this Warning when I use yarn start. Maybe it's this that gives us the error? This would mean that at some point in time some files in node_modules got deleted.

Quackaholic-Quacktivity commented 1 year ago

Currently still haven't found the Problem. I think I might need some help on this issue.

brenzi commented 1 year ago

@clangenb

clangenb commented 1 year ago

Can you double-check if it still exists? I can't reproduce it now (I used to be able to do it I think), it could be that https://github.com/encointer/explorer/pull/116 accidentally fixed the issue.

EDIT: I can't reproduce it locally with yarn start in chrome, firefox and brave on a88f28cd841d784939a6777701dbe60dfa50ab41

clangenb commented 1 year ago

Haha, sometimes you need to trust your guts, I think https://github.com/encointer/explorer/pull/118 fixed it. The deployed version does not have the error anymore.