theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
109 stars 8 forks source link

'Edit Location' is broken #4224

Closed JonasR closed 9 months ago

JonasR commented 10 months ago

Clicking the button will load the edit page, but there are no buttons to draw locations, and even if a location is already assigned to the area, the map will not show it but instead show the highest zoom level.

Not sure if this is related to the missing .js file

image
scd commented 10 months ago

Something strange is happening because it is working for me, but I did notice this once then it fixed itself when I reloaded. Can you please provide a link to the area so we know I am opening the same area.

JonasR commented 10 months ago

That's interesting. I tried various areas to make sure it's not just one. This is the one from my screenshot: https://www.thecrag.com/en/climbing/slovenia/crni-kal and when I access it now, it works fine. I also tried https://www.thecrag.com/en/climbing/germany/oberbayern/area/686754543 a day earlier, when I first noticed the issue, and that one also didn't work (but does now).

Not sure what caused this.

Edit: Actually, I just realized I'm trying from a different machine now, than I was earlier today when I opened the issue. Let me verify on the other one as well... Edit2: Jep, still 'broken' on my other machine. Let me try and find out what the difference between the two is...

JonasR commented 10 months ago

After some more testing:

Both machines use the same Chrome profile with settings synced and Chrome on version 116.0.5845.141. I'm logged into my account on both machines. Adblocker disabled on both. Both machines route DNS requests through my pihole, but there's nothing relevant in its logs and disabling it doesn't change anything either. The request for tc_template.js returns with a 404 on both machines, so it's not about that I guess.

Logout, login again, empty cache & hard reload, don't help. Also tried with a completely new Chrome profile, but doesn't do anything either.

scd commented 10 months ago

tc_templates.js is old and should not be required. I am thinking it is something to do with the API not returning properly.

Can you look at what all the API calls return for the broken machine.

JonasR commented 10 months ago

All other requests on the site appear to return just fine with HTTP200 or 204. I couldn't really find anything else that looks like an issue. If it helps, here is a .har of loading https://www.thecrag.com/en/climbing/germany/oberbayern/area/686754543/locate: www.thecrag.com.har.zip

I don't get the Cannot read properties of null (reading 'addBoundaryToLayer') on the machine where it works, so that's probably the issue, but I'm not sure why it occurs.

When debugging it, geometry is defined, and I can create a fence object just fine, but somehow the fence variable is null regardless (see console in the screenshot below). Some kind of race condition? I don't really know JS unfortunately :/

image
scd commented 10 months ago

Thanks for your efforts here. I am away for a couple of weeks so this will not be resolved soon, but it is good to get some front end investigation done before we start working on it.

killakalle commented 9 months ago

I'm running into the same issue with Chrome on OSX. The same node with Safari works fine:

left: Chrome; right: Safari image

JonasR commented 9 months ago

I hadn't considered that, but indeed on the machine with the 'broken' Chrome, it works fine with Edge and Firefox.

scd commented 9 months ago

Thanks for all your help with finding the broken edge cases. We have found the bug and hotfixed.