<p></p>
<p dir="auto">Most controllers have the same set of <code class="notranslate">around_action</code> filters, e.g.</p>
<div class="highlight highlight-source-ruby" dir="auto"><pre class="notranslate"><span class="pl-en">around_action</span> <span class="pl-pds">:api_call_handle_error</span><span class="pl-kos">,</span> <span class="pl-pds">:api_call_timeout</span></pre></div>
<p dir="auto">However, some don't:</p>
<ul dir="auto">
<li>api/users_controller: <code class="notranslate">around_action :api_call_handle_error</code> - I think the lack of timeout is an oversight?</li>
<li>api/user_preferences_controller: <code class="notranslate">around_action :api_call_handle_error</code> - again, I think this is an oversight?</li>
<li>api/changesets_controller: <code class="notranslate">around_action :api_call_handle_error; around_action :api_call_timeout, :except => [:upload]</code> - I can see a logic for removing the timeout for the upload, since it could be quite big (n.b. rails not used in production for this)</li>
<li>api/traces_controller: <code class="notranslate">around_action :api_call_handle_error</code> - I think adding the timeout handling here would be fine, but maybe exempt <code class="notranslate">:create</code> to align with changesets#upload ?</li>
</ul>
<p dir="auto">I would like to refactor the controllers, similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2323536440" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4859" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4859/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4859">#4859</a> so that these handlers are applied by default, and exceptions are used (e.g. <code class="notranslate">skip_around_action</code> only where necessary.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/4861">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLM7AVLA3ZIKTCPYSGLZEYPMZAVCNFSM6AAAAABIPQDL62VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZDIMBRHE4DQMQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNOAK44OZIEP72INJ3ZEYPMZA5CNFSM6AAAAABIPQDL62WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIVBN2VI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/4861</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/4861",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/4861",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>