Skip to content

SocialPostTargetRetryScheduledNotification

Published when the network was limiting requests, so nothing was sent, and UmbSocial put the channel back in the queue to send it again by itself. See When the network is limiting requests.

It is published for each try. Nothing has failed yet: SocialPostTargetFailedNotification, SocialPostOutcomeRecordedNotification and the Social post failed or outcome unknown webhook come only when UmbSocial gives up. The post’s history gets a Rate limited, trying again entry (retryScheduled) from it.

The following properties are available within the notification

Property Name Type Use
Target SocialPostTargetInfo The target as saved: Status is Pending and Attempt is one more than the attempt the network turned away.
RetryAtUtc DateTime When it is sent again (UTC), no sooner: the configured wait, or the time the network said its limit resets.
RetryNumber int Which automatic try this is, from 1.
MaxRetries int How many automatic tries there are before UmbSocial gives up (6 by default, see Configuration).

See SocialPostRetryingNotification for SocialPostTargetInfo.

LogRateLimits.cs
using Microsoft.Extensions.Logging;
using UmbSocial.Core.Notifications;
using Umbraco.Cms.Core.Events;
public sealed class LogRateLimits(ILogger<LogRateLimits> logger) : INotificationAsyncHandler<SocialPostTargetRetryScheduledNotification>
{
public Task HandleAsync(SocialPostTargetRetryScheduledNotification notification, CancellationToken cancellationToken)
{
logger.LogInformation("Post {PostId} was rate-limited on {Network}: try {Try} of {Max} at {At:u}",
notification.Target.PostId, notification.Target.Network, notification.RetryNumber, notification.MaxRetries, notification.RetryAtUtc);
return Task.CompletedTask;
}
}

Register it in a composer with builder.AddNotificationAsyncHandler<SocialPostTargetRetryScheduledNotification, LogRateLimits>();.