Hi,
I think i found a bug while i was trying to get notifications with signal IR work with my project. Because i couldn't get it work i downloaded a fresh project from aspnetboilerplate and i disabled this line inside CoreModule
Configuration.MultiTenancy.IsEnabled = true;
and notifications stop working. If i enable multitenancy again, notifications with signal IR work again. I think the problem is the implementation of this method: _realTimeNotifier.SendNotificationsAsync(Notifications). I does nothing when used in single tenant mode.
My test work was this one:
public async Task UpdateTask()
{
var data2 = new MessageNotificationData("The update task has started");
var userId = new UserIdentifier(null, AbpSession.UserId ?? 1);
_notificationPublisher.Publish("UpdateMainData", data2, userIds: new[] { userId });
var not = _userNotificationManager.GetUserNotifications(userId);
_realTimeNotifier.SendNotificationsAsync(not.ToArray());
}
Thanks.
1 Answer(s)
-
0
Hi,
By defining a UserIdentifier like this
var userId = new UserIdentifier(null, AbpSession.UserId ?? 1);
you are pointing a user in host account by giving first parameter null to UserIdentifier.
If you disable MultiTenancy, then you should give tenantId to UserIdentifier.
var userId = new UserIdentifier(1, AbpSession.UserId ?? 1);
Even netter, you can use this.
var userId = AbpSession.ToUserIdentifier();