Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread Anton Khorev via rails-dev
> I imagined this would require storing an ‘anonymous visitor ID’ in the cookie This thing already exists as session id in `_osm_session` cookie. And that's another option. Instead of managing the counter and its expiration date in javascript, you can make a request at some special endpoint afte

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread Anton Khorev via rails-dev
> I am not a specialist of cookies VS localStorage, the only advantage of > cookies is the possibility to set an expiration date ? The browser sends cookies to the server. It doesn't send localStorage. If the server knows the counter value, it can display another message based on that value, th

Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)

2025-01-05 Thread David Tsiklauri via rails-dev
@nertc commented on this pull request. > +if (!locationInput.dirty || > locationName.includes(locationInput.countryName)) { + $("#location_name_warning").addClass("d-none"); +} else { + $("#location_name_warning").removeClass("d-none"); +} As we updated logic, this code b

Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)

2025-01-05 Thread David Tsiklauri via rails-dev
@nertc commented on this pull request. > +http://www.w3.org/2000/svg"; width="16" > height="16" fill="currentColor" class="bi bi-geo-alt-fill" viewBox="0 0 16 > 16"> + + `<%= t ".home location" %>` was added to the svg. -- Reply to this emai

Re: [openstreetmap/openstreetmap-website] Remove old browse redirects (PR #5463)

2025-01-05 Thread Tom Hughes via rails-dev
They're not obviously bots, no. Many have no referer and ordinary looking user agents. At least one group was obviously mastodon instances doing URL previews because somebody had presumably tooted a URL somewhere. There are none I can see to `/forgot-password.html` yesterday but a handful to `c

Re: [openstreetmap/openstreetmap-website] Remove old browse redirects (PR #5463)

2025-01-05 Thread Anton Khorev via rails-dev
Are those bots? Are there hits on `/create-account.html` or `/forgot-password.html`? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5463#issuecomment-2572418161 You are receiving this because you are subscribed to this thread. M

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread etiennejourdier via rails-dev
@etiennejourdier commented on this pull request. > @@ -152,6 +152,16 @@ OSM.NewNote = function (map) { .on("input", updateControls) .focus(); +var anonymousNotesCount = Number(localStorage.getItem("anonymousNotesCount")); + +if (typeof OSM.user === "undefined" && anonymo

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread etiennejourdier via rails-dev
@etiennejourdier commented on this pull request. > @@ -162,6 +172,9 @@ OSM.NewNote = function (map) { newNoteMarker.dragging.disable(); createNote(location, text, (feature) => { +if (typeof OSM.user === "undefined") { + localStorage.setItem("anonymousNotesCount",

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread Holger Jeromin via rails-dev
@HolgerJeromin commented on this pull request. > @@ -162,6 +172,9 @@ OSM.NewNote = function (map) { newNoteMarker.dragging.disable(); createNote(location, text, (feature) => { +if (typeof OSM.user === "undefined") { + localStorage.setItem("anonymousNotesCount", a

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread etiennejourdier via rails-dev
@etiennejourdier commented on this pull request. > @@ -162,6 +172,9 @@ OSM.NewNote = function (map) { newNoteMarker.dragging.disable(); createNote(location, text, (feature) => { +if (typeof OSM.user === "undefined") { + localStorage.setItem("anonymousNotesCount",

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread etiennejourdier via rails-dev
> I'd store the counter in a cookie, set an expiration date I am not a specialist of cookies VS localStorage, the only advantage of cookies is the possibility to set an expiration date ? > replace the existing "You are not logged in" alert with this more motivating > one good idea ! > with a

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread etiennejourdier via rails-dev
@etiennejourdier commented on this pull request. > @@ -152,6 +152,16 @@ OSM.NewNote = function (map) { .on("input", updateControls) .focus(); +var anonymousNotesCount = Number(localStorage.getItem("anonymousNotesCount")); + +if (typeof OSM.user === "undefined" && anonymo

Re: [openstreetmap/openstreetmap-website] bug with selenium while running the tests (Issue #5467)

2025-01-05 Thread etiennejourdier via rails-dev
> A snap based firefox is unlikely to work. OK, that's most likely the reason, I'll have to migrate from snap version to apt version to check. I think a warning in CONTRIBUTING.md would be welcome for beginners like me! -- Reply to this email directly or view it on GitHub: https://github.com/o

Re: [openstreetmap/openstreetmap-website] bug with selenium while running the tests (Issue #5467)

2025-01-05 Thread etiennejourdier via rails-dev
> Don't the docs tell you to run it as `bundle exec erblint .`? oops, sorry, my mistake, I didn't see the `.` ... -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5467#issuecomment-2571747871 You are receiving this because you ar

Re: [openstreetmap/openstreetmap-website] "layeradd layerremove" event handlers dramatically slow down Map data layer rendering (Issue #5466)

2025-01-05 Thread Roman Deev via rails-dev
> parse the response as json() This is not necessary yet. I have increased the limit of the maximum number of nodes for the local openstreetmap-cpimap, and I can say that parsing XML, which is 50 MB in decompressed form, only took 2 seconds. However, it took 10 seconds to download. -- Reply

Re: [openstreetmap/openstreetmap-website] "layeradd layerremove" event handlers dramatically slow down Map data layer rendering (Issue #5466)

2025-01-05 Thread mmd via rails-dev
By the way, if you're looking into map data layer performance, we're also spending some time in XML parsing (DOMParser.parseFromString). Maybe we could switch to /map.json and directly parse the response as json(). Both Rapid and iD are using json for performance reasons. -- Reply to this emai

Re: [openstreetmap/openstreetmap-website] Add OldElementsController base class (PR #5464)

2025-01-05 Thread Tom Hughes via rails-dev
Merged #5464 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5464#event-15817780552 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Add OldElementsController base class (PR #5464)

2025-01-05 Thread Tom Hughes via rails-dev
Looks good to me, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5464#issuecomment-2571683359 You are receiving this because you are subscribed to this thread. Message ID: ___

Re: [openstreetmap/openstreetmap-website] Pass bbox to changeset page via data attribute (PR #5471)

2025-01-05 Thread Tom Hughes via rails-dev
Merged #5471 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5471#event-15817759685 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Javascript error when opening a page of a changeset without a bounding box (Issue #4081)

2025-01-05 Thread Tom Hughes via rails-dev
Closed #4081 as completed via #5471. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/4081#event-15817759716 You are receiving this because you are subscribed to this thread. Message ID: _

Re: [openstreetmap/openstreetmap-website] Inconsistency between a link and the text of the link on copyright page (Issue #5472)

2025-01-05 Thread Tom Hughes via rails-dev
We have no control over that page and I believe OSMF changed it because it was getting too much spam. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5472#issuecomment-2571681182 You are receiving this because you are subscribed

Re: [openstreetmap/openstreetmap-website] Remove zoomend listener on history unload (PR #5470)

2025-01-05 Thread Tom Hughes via rails-dev
Merged #5470 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5470#event-15817759684 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Pass bbox to changeset page via data attribute (PR #5471)

2025-01-05 Thread Tom Hughes via rails-dev
Looks good to me, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5471#issuecomment-2571680307 You are receiving this because you are subscribed to this thread. Message ID: ___

Re: [openstreetmap/openstreetmap-website] Show outbox after sending new message (PR #5465)

2025-01-05 Thread Tom Hughes via rails-dev
Merged #5465 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5465#event-15817759692 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Fix allow_thirdparty_images options (PR #5469)

2025-01-05 Thread Tom Hughes via rails-dev
Merged #5469 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5469#event-15817759683 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

[openstreetmap/openstreetmap-website] Inconsistency between a link and the text of the link on copyright page (Issue #5472)

2025-01-05 Thread Mahabarata via rails-dev
### URL https://www.openstreetmap.org/copyright/en ### How to reproduce the issue? At the bottom of the page, you can see, just above the "Trademarks" section, the text "or file directly at our [on-line filing page](https://dmca.openstreetmap.org/)." When following the link, the page is not a

Re: [openstreetmap/openstreetmap-website] Remove zoomend listener on history unload (PR #5470)

2025-01-05 Thread Tom Hughes via rails-dev
Looks good to me, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5470#issuecomment-2571677461 You are receiving this because you are subscribed to this thread. Message ID: ___

Re: [openstreetmap/openstreetmap-website] Fix allow_thirdparty_images options (PR #5469)

2025-01-05 Thread Tom Hughes via rails-dev
Looks good to me, and the others should definitely be fixed as well. I believe the `allow_all_form_action` one is related to a difference in how browsers enforce CSP for form submissions - specifically some (eg Firefox) only require that the initial URL submitted to meet the form action policy w

Re: [openstreetmap/openstreetmap-website] Show outbox after sending new message (PR #5465)

2025-01-05 Thread Tom Hughes via rails-dev
Seems reasonable to me, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5465#issuecomment-2571675158 You are receiving this because you are subscribed to this thread. Message ID: __

Re: [openstreetmap/openstreetmap-website] Remove old browse redirects (PR #5463)

2025-01-05 Thread Tom Hughes via rails-dev
I'm afraid to say there were still about 26000 hits on `/browse` yesterday :disappointed: -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5463#issuecomment-2571673889 You are receiving this because you are subscribed to this thre

Re: [openstreetmap/openstreetmap-website] Pass bbox to changeset page via data attribute (PR #5471)

2025-01-05 Thread Anton Khorev via rails-dev
@AntonKhorev pushed 1 commit. c887f1d7b29ff6a125ebe70ff15609a005f99fba Use details attribute to render changeset bounding box -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5471/files/68c37f8f29440f0464ec1832b9beee96605c0c30..c887f1d7b29ff6a125ebe70ff15609a00

[openstreetmap/openstreetmap-website] Pass bbox to changeset page via data attribute (PR #5471)

2025-01-05 Thread Anton Khorev via rails-dev
Fixes #4081 on `/changeset/:id` pages. Previously changeset bbox was loaded using `L.OSM.DataLayer`. That requied additional http request. Also `L.OSM.DataLayer` assumed that all changesets have bounding boxes which is not true. You can view, comment on, or merge this pull request online at:

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread Christian Quest via rails-dev
> If they're valid notes I don't really see the problem? Are these genuine > notes or is this some sort of spam attack? A large part of them are not valid or useless. This PR should not be seen as a way to solve a one guy problem, but a global issue with anonymous notes. The lack of communicati

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread Donat ROBAUX via rails-dev
> If they're valid notes I don't really see the problem? Are these genuine > notes or is this some sort of spam attack? This contributor's notes are potentially problematic and pollute the other notes. ![image](https://github.com/user-attachments/assets/8fc81574-7ea4-40eb-9d93-80a0f33d791c) --

Re: [openstreetmap/openstreetmap-website] "layeradd layerremove" event handlers dramatically slow down Map data layer rendering (Issue #5466)

2025-01-05 Thread Roman Deev via rails-dev
This looks better, but will need to be fixed too. https://github.com/openstreetmap/openstreetmap-website/blob/95b919c5d1e33688b0841c7d38602372c2e4c4a3/app/assets/javascripts/leaflet.share.js#L272 And also understand how to track changes in the active object, which should be updated in the link o

[openstreetmap/openstreetmap-website] Remove zoomend listener on history unload (PR #5470)

2025-01-05 Thread Anton Khorev via rails-dev
https://github.com/openstreetmap/openstreetmap-website/commit/6b194ed6278d4b05a04a20d6907203ed329bef77 added a map zoom listener to history pages because rendered changeset rectangles depend on the map scale. But the listener is never removed on unload. You can view, comment on, or merge this pul

Re: [openstreetmap/openstreetmap-website] "layeradd layerremove" event handlers dramatically slow down Map data layer rendering (Issue #5466)

2025-01-05 Thread Anton Khorev via rails-dev
Maybe listening to "moveend baselayerchange overlaylayerchange" is going to help. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5466#issuecomment-2571570472 You are receiving this because you are subscribed to this thread. Me

Re: [openstreetmap/openstreetmap-website] "layeradd layerremove" event handlers dramatically slow down Map data layer rendering (Issue #5466)

2025-01-05 Thread Roman Deev via rails-dev
What if we add a layer type check to the handler for which the handler was triggered? Something like: ```js map.on("moveend layeradd layerremove", function (e) { if (!L.TileLayer.prototype.isPrototypeOf(e?.layer)){ return } updateLinks( map.getCenter().wrap(), map.

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread Holger Jeromin via rails-dev
@HolgerJeromin commented on this pull request. > @@ -152,6 +152,16 @@ OSM.NewNote = function (map) { .on("input", updateControls) .focus(); +var anonymousNotesCount = Number(localStorage.getItem("anonymousNotesCount")); ```suggestion var anonymousNotesCount = Number(lo

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-05 Thread Holger Jeromin via rails-dev
@HolgerJeromin commented on this pull request. > @@ -162,6 +172,9 @@ OSM.NewNote = function (map) { newNoteMarker.dragging.disable(); createNote(location, text, (feature) => { +if (typeof OSM.user === "undefined") { + localStorage.setItem("anonymousNotesCount", a