middleware = next => action => {
        const payload = parseTask(action)
        if (payload) {
          const { id, duration, error } = payload
          addEventWrapped({ id, duration })

          // Record errors. Only from explicitly selected actions.
          if (error) {
            root.Countly.q.push(['add_log', action.type])
            root.Countly.q.push(['log_error', error])
            // LogRocket.error(error)
            // logger.error('Error in action', action.type, error)
          }
        }

        return next(action)
      }
@param {function(Message):void} next
@returns {function(Message):void}