Webhook: refactor and solve alerts ending up requiring additional requests
davidor opened this issue · 0 comments
davidor commented
Issue reported by @unleashed:
backend requires further activity to "flush" alerts to system.
The whole alerts code (event_storage.rb particularly) is rather low quality. We should improve the design (avoiding the problem above) and fix the awful code that handles the webhook. A Webhook class should be created (nice if it also can handle custom Host headers), and used, hopefully without the need to re-create the client and being configurable for timeouts with proper error handling.
The "proper error handling" part is avoiding horrible stuff like rescue => e; notify(); end which caused NoMethodError, NameError and LoadError among others to inflict infinite pain to me for hours.