diff --git a/doc/user/content/release_notes/_index.md b/doc/user/content/release_notes/_index.md index 9dff2f59f..e2633e959 100644 --- a/doc/user/content/release_notes/_index.md +++ b/doc/user/content/release_notes/_index.md @@ -4,6 +4,9 @@ weight = 3 sort_by = "weight" insert_anchor_links = "right" +++ +## 1.5.3 + - Avoided logging when warming up cache + ## 1.5.2 - Added better logging to AlgoDefinitionService diff --git a/src/client/spark/Notifications/INotificationService.cs b/src/client/spark/Notifications/INotificationService.cs index eb3823cc7..282fcd3ca 100644 --- a/src/client/spark/Notifications/INotificationService.cs +++ b/src/client/spark/Notifications/INotificationService.cs @@ -25,20 +25,28 @@ namespace bts.shell { } static class NotificationServiceExtensions { + /// TODO: remove this extension and force callers to use the appropriate 'link' method in (it is smelly, and is NOT ACTUALLY STRONGLY TYPED) public static IDisposable link(this INotificationService notification_service, IPredicate predicate, SoundNotification sound) { if (predicate is IPredicate orp) return notification_service.link_to_order(orp, sound); + if (predicate is IPredicate osp) { + // Note: watch out for implicit types as generic type arguments (although OrderSecurity can be implicitly cast to OrderTuple, IPredicate CANNOT be implicitly cast to IPredicate) + return notification_service.link_to_order(PredicateBuilder.create(ot => osp.trigger(new OrderSecurity(ot.Item1, ot.Item2))), sound); + } if (predicate is IPredicate ap) return notification_service.link_to_activity(ap, sound); - throw new ArgumentException(nameof(predicate)); + Log.Ui.error($"Unable to activate sound-trigger (unrecognized predicate type '{typeof(T)}')."); + return Disposable.empty; } + /// TODO: remove this extension and force callers to use the appropriate 'link' method in (it is smelly, and is NOT ACTUALLY STRONGLY TYPED) public static IDisposable link(this INotificationService notification_service, INotificationPredicate toast_notification_predicate) { if (toast_notification_predicate is INotificationPredicate orp) return notification_service.link_to_order(orp); if (toast_notification_predicate is INotificationPredicate ap) return notification_service.link_to_activity(ap); - throw new ArgumentException(nameof(toast_notification_predicate)); + Log.Ui.error($"Unable to activate toast-notification-trigger (unrecognized predicate type '{typeof(T)}')."); + return Disposable.empty; } } diff --git a/src/lib/orderman/orders/NativeOrder.h b/src/lib/orderman/orders/NativeOrder.h index 7acc4e92d..2b79388a9 100644 --- a/src/lib/orderman/orders/NativeOrder.h +++ b/src/lib/orderman/orders/NativeOrder.h @@ -43,7 +43,9 @@ class NativeOrder : public Order { void on_cancel_reject(const CancelRejectEvent &); void on_gateway_status(const GatewayStatusChangeEvent &); void report_state(); - OrderOpResult _on_activate(Price p, Quantity q, + OrderOpResult _on_activate(log::Level reject_level, + log::Level transition_level, + Price p, Quantity q, bts::orderman::OrderServices &services); void init_fix(); void add_exchange_order_id_to_fix();