openstreetmap-website icon indicating copy to clipboard operation
openstreetmap-website copied to clipboard

HTML rendered in UI

Open egelmex opened this issue 3 months ago • 10 comments

URL

No response

How to reproduce the issue?

Image

when trying to post to a note

Screenshot(s) or anything else?

No response

egelmex avatar Sep 30 '25 08:09 egelmex

@gravitystorm @Firefishy - Where does this message live? I'm assuming load balancer? I can't find it anywhere in our repos.

pablobm avatar Sep 30 '25 09:09 pablobm

It's the page passenger renders if the queue is full.

tomhughes avatar Sep 30 '25 09:09 tomhughes

There was a brief spike just after 0800 UTC when the things may have been overloaded:

Image

tomhughes avatar Sep 30 '25 09:09 tomhughes

I'm not really sure why this was closed though I'm also not sure what we can do about it.

tomhughes avatar Oct 23 '25 21:10 tomhughes

I'm also not sure what we can do about it.

parse the XML and use the textContent if the message starts with a <?

hlfan avatar Oct 23 '25 21:10 hlfan

We could simplify this a lot (and fix various other things, e.g. #6367) if we rewrote the notes UI to just be standard rails views. The current situation, where it runs as a mini-SPA built to use the API, adds more complexity (and edge cases) than is necessary, imho.

gravitystorm avatar Oct 27 '25 09:10 gravitystorm

Looking at how this works currently, with view to creating a descriptive issue. Is my understanding below correct?

The interface is glued together by the router, which handles page loads (full or pushState). This is similar to how libraries like Sammy.js or Davies.js used to do it back at the time when this was built.

Each route handles a module (eg: index/new_note.js) which does a lot of JS-based heavy lifting, handling state, interacting with the API and rendering results on the appropriate panel.

Ideally this should be converted to use Hotwire. Rather than a big bang rewrite, we might be able to convert each individual route separately (eg: NewNote) and only remove the router at the end, if everything has indeed been converted.

Does that sound right?

pablobm avatar Oct 28 '25 11:10 pablobm

Well the main issue @gravitystorm was talking about is that fact that the web site interface to notes (unlike most things) is implemented in javascript using API calls rather than having separate rails/web routes.

Separately there is the issue of the client side javascript router thing that none of us understands properly and which we'd love to replace with hotwire/turbo etc yes.

So yes please feel free to work on those things!

When in comes to notes it may also be worth looking at the previous tickets around the data model and the ideas for improving it which I think are currently partially implemented.

tomhughes avatar Oct 28 '25 11:10 tomhughes

Adding to that router confusion is that some of the JS controller invoking code is mixed into the JS controller code. To separate those there's #6295.

hlfan avatar Oct 28 '25 12:10 hlfan

I have reframed this issue in terms of the solution (as suggested above), the root cause, and related issues at https://github.com/openstreetmap/openstreetmap-website/issues/6495

pablobm avatar Nov 03 '25 14:11 pablobm