[openstreetmap/openstreetmap-website] [iD] fix glitchy zoom level caused by out-of-order event handlers (PR #7134)
Martin Raifer
notifications at github.com
Thu Jun 4 13:44:56 UTC 2026
see https://github.com/openstreetmap/iD/issues/10700#issuecomment-4615707609 for a slightly deeper analysis.
tldr; normally, the `onIframeHashChange` event is immediately followed by the respective `hashchange` event. But in some conditions (when the js main thread is busy with something else), it can happen that multiple `onIframeHashChange` events/messages are received right after each other, before the respective `hashchange` events are called. The mechanism that detects whether a hash change was "automatic" (set programmatically from inside the iframe by iD) relies on the order of events to always be consistent.
This makes the implementation more robust by remembering which concrete hashchanges were triggered by the incoming iframe messages, avoiding duplicate/nop changes, and only updating the editor's map location if the hash change really did not come from the iD iframe itself.
fixes https://github.com/openstreetmap/iD/issues/10700
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/7134
-- Commit Summary --
* fix detection of automatic hash changes for out-of-order events
-- File Changes --
M app/assets/javascripts/edit/id.js.erb (10)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/7134.patch
https://github.com/openstreetmap/openstreetmap-website/pull/7134.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7134
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7134 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260604/dab324f4/attachment.htm>
More information about the rails-dev
mailing list