[openstreetmap/openstreetmap-website] Refactor api_call_* filters (Issue #4861)

Andy Allan notifications at github.com
Wed May 29 18:49:48 UTC 2024


Most controllers have the same set of `around_action` filters, e.g.

```ruby
around_action :api_call_handle_error, :api_call_timeout
```

However, some don't:
* api/users_controller: `around_action :api_call_handle_error` - I think the lack of timeout is an oversight?
* api/user_preferences_controller: `around_action :api_call_handle_error` - again, I think this is an oversight?
* api/changesets_controller: `around_action :api_call_handle_error;  around_action :api_call_timeout, :except => [:upload]` - 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)
* api/traces_controller: `around_action :api_call_handle_error` - I think adding the timeout handling here would be fine, but maybe exempt `:create` to align with changesets#upload ?

I would like to refactor the controllers, similar to #4859 so that these handlers are applied by default, and exceptions are used (e.g. `skip_around_action` only where necessary.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/4861
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/4861 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240529/da7b39e7/attachment.htm>


More information about the rails-dev mailing list