[openstreetmap/openstreetmap-website] Cancel pending Export sidebar loads on unload (PR #7268)
Marwin Hochfelsner
notifications at github.com
Fri Aug 7 05:26:39 UTC 2026
@hlfan commented on this pull request.
> @@ -146,6 +149,15 @@ OSM.Router = function (map, rts) {
window.history.replaceState(OSM.parseHash(url), document.title, url);
};
+ router.withAbortSignal = function (callback) {
+ return callback(abortController.signal)
+ .catch(error => {
+ // Do not resolve aborted requests and run the exiting controller's callbacks.
+ if (error.name === "AbortError") return new Promise(() => {});
A stale promise just leads to the router becoming unresponsive. Why catch at all?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7268#discussion_r3733630326
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7268/review/4880187046 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260806/b2c8f67b/attachment.htm>
More information about the rails-dev
mailing list