Real-time notifications not working when an EntityIdentifier is set
See original GitHub issuePlatform: ABP 5.1.0 (ASP.NET Core MVC)
Something is wrong with NotificationPublisher
when a notification is sent including an EntityIdentifier
. When a notification with that parameter set is sent, SignalR disconnects and reconnects, and the notification is never displayed. To see the notification I am forced to refresh the page.
If I simply remove the EntityIdentifier
parameter, that same notification works correctly with SignalR.
Sample with the error:
public async Task DataClearedAsync(Guid processStatusId, int tenantId, int userId)
{
var notificationData = new LocalizableMessageNotificationData(
new LocalizableString(
"ClearDataNotificationMessage",
InAccessConsts.LocalizationSourceName
)
);
await _notificationPublisher
.PublishAsync(AppNotificationNames.ClearData,
notificationData,
new Abp.Domain.Entities.EntityIdentifier(typeof(ProcessStatus), processStatusId),
userIds: new[] { new UserIdentifier(tenantId, userId) },
severity: NotificationSeverity.Success);
}
Sample that works correctly:
public async Task DataClearedAsync(Guid processStatusId, int tenantId, int userId)
{
var notificationData = new LocalizableMessageNotificationData(
new LocalizableString(
"ClearDataNotificationMessage",
InAccessConsts.LocalizationSourceName
)
);
notificationData["processStatusId"] = processStatusId;
await _notificationPublisher
.PublishAsync(AppNotificationNames.ClearData,
notificationData,
userIds: new[] { new UserIdentifier(tenantId, userId) },
severity: NotificationSeverity.Success);
}
I suspect this might be a JSON serialization error with the EntityIdentifier that breaks the JSON SignalR generates for the notification.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Real-time notifications not working when an EntityIdentifier ...
Currently we are using Abp, Version=5.2.0.0. ... Still we are facing this Real-time notifications not working when an EntityIdentifier is set.
Read more >Real time notification system
Users may want to get notifications for some photos, but not for all. ... It can be set using new EmailRealTimeNotifier().GetType().
Read more >Understanding Real-Time Notifications | In-App Purchasing
Real-Time Notifications (RTN) are server-to-server push notifications that provide comprehensive data about in-app purchases in real time.
Read more >Fix subscriber notification problems - YouTube Help
Viewer notification settings cause almost all notification issues. Ask viewers to use the notifications troubleshooter if they aren't getting notifications.
Read more >Get Started with Registration and the Unique Entity ID
You have 2 new alerts. Show / Hide Alerts ... The unique entity identifier used in SAM.gov has changed. On April 4, 2022,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reproduced and fixed; see PR #5231.
@ismcagdas I’m using aspnetzero v11 so it’s abp v7.1, attached screenshots below, only ‘AbpNotificationSubscriptions’ contains records of specific notifications. user id 1 and 2 both are subscribed but won’t get notifications.
Any mistake in code below?