question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Real-time notifications not working when an EntityIdentifier is set

See original GitHub issue

Platform: 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:closed
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
acjhcommented, Jan 18, 2020

Reproduced and fixed; see PR #5231.

0reactions
nimeshvaghasiyacommented, Jul 22, 2022

@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?

Code

Result

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found