I have now compared the logs between a working application with ABP 8.1.0 and my problem app with version with ABP 8.2.2.
Here is the difference in the log when closing a browser tab:
Blazor Server App with ABP 8.1.0 (everything fine)
2025-03-21 17:25:10.677 +01:00 [INF] Request starting HTTP/2 POST https://localhost:44341/_blazor/disconnect - multipart/form-data; boundary=----WebKitFormBoundaryLKTHDnNIYH3gmiLr 359
2025-03-21 17:25:10.678 +01:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri.
2025-03-21 17:25:10.678 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri.
2025-03-21 17:25:10.678 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType.
2025-03-21 17:25:10.678 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType.
2025-03-21 17:25:10.678 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateTransportSecurityRequirement.
2025-03-21 17:25:10.678 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader.
2025-03-21 17:25:10.687 +01:00 [DBG] Get dynamic claims cache for user: 7feb2acd-742e-5eea-91ce-3a11e4ceaa41
2025-03-21 17:25:10.688 +01:00 [INF] Executing endpoint 'Blazor disconnect'
2025-03-21 17:25:10.767 +01:00 [INF] Executed endpoint '/_blazor'
2025-03-21 17:25:10.767 +01:00 [INF] Request finished HTTP/1.1 GET https://localhost:44341/_blazor?id=RDJXbzEi_-BTtSeihTm2Yg - 101 null null 19127.4719ms
Blazor Server App with ABP 8.2.2
2025-03-21 17:18:52.406 +01:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri.
2025-03-21 17:18:52.414 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri.
2025-03-21 17:18:52.433 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType.
2025-03-21 17:18:52.451 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType.
2025-03-21 17:18:52.506 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateTransportSecurityRequirement.
2025-03-21 17:18:52.533 +01:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader.
2025-03-21 17:18:52.551 +01:00 [DBG] Get dynamic claims cache for user: f487c7e2-64bf-73ca-b12f-3a13383af04e
2025-03-21 17:18:52.601 +01:00 [DBG] Get dynamic claims cache for user: f487c7e2-64bf-73ca-b12f-3a13383af04e
2025-03-21 17:18:52.617 +01:00 [WRN] The operation was canceled.
System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token)
at Volo.Abp.Caching.DistributedCache`2.GetAsync(TCacheKey key, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)
2025-03-21 17:18:53.212 +01:00 [ERR] Error when dispatching 'OnDisconnectedAsync' on hub.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Volo.Abp.Threading.SemaphoreSlimExtensions.LockAsync(SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken)
at Volo.Abp.Caching.DistributedCache`2.GetOrAddAsync(TCacheKey key, Func`1 factory, Func`1 optionsFactory, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)
at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributorCache.GetAsync(Guid userId, Nullable`1 tenantId)
at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributor.ContributeAsync(AbpClaimsPrincipalContributorContext context)
at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.InternalCreateAsync(AbpClaimsPrincipalFactoryOptions options, ClaimsPrincipal existsClaimsPrincipal, Boolean isDynamic)
at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.CreateDynamicAsync(ClaimsPrincipal existsClaimsPrincipal)
at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.HandleDynamicClaimsPrincipalAsync(ClaimsPrincipal claimsPrincipal, IServiceProvider serviceProvider, HubCallerContext hubCallerContext, Boolean skipCheckDynamicClaimsInterval)
at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.HubOnDisconnectedAsync(HubConnectionContext connection, Exception exception)
2025-03-21 17:18:53.676 +01:00 [ERR] Failed disposing connection Lk2CIWX22T3WTLFJ1qejhg.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Volo.Abp.Threading.SemaphoreSlimExtensions.LockAsync(SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken)
at Volo.Abp.Caching.DistributedCache`2.GetOrAddAsync(TCacheKey key, Func`1 factory, Func`1 optionsFactory, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)
at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributorCache.GetAsync(Guid userId, Nullable`1 tenantId)
at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributor.ContributeAsync(AbpClaimsPrincipalContributorContext context)
at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.InternalCreateAsync(AbpClaimsPrincipalFactoryOptions options, ClaimsPrincipal existsClaimsPrincipal, Boolean isDynamic)
at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.CreateDynamicAsync(ClaimsPrincipal existsClaimsPrincipal)
at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.HandleDynamicClaimsPrincipalAsync(ClaimsPrincipal claimsPrincipal, IServiceProvider serviceProvider, HubCallerContext hubCallerContext, Boolean skipCheckDynamicClaimsInterval)
at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.HubOnDisconnectedAsync(HubConnectionContext connection, Exception exception)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.RunHubAsync(HubConnectionContext connection)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.OnConnectedAsync(ConnectionContext connection)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.OnConnectedAsync(ConnectionContext connection)
at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionContext.ExecuteApplication(ConnectionDelegate connectionDelegate)
at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionContext.WaitOnTasks(Task applicationTask, Task transportTask, Boolean closeGracefully)
at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionContext.DisposeAsync(Boolean closeGracefully)
at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionManager.DisposeAndRemoveAsync(HttpConnectionContext connection, Boolean closeGracefully, HttpConnectionStopStatus status)
In the version below with the exception, you can see that the following is missing:
2025-03-21 17:25:10.677 +01:00 [INF] Request starting HTTP/2 POST https://localhost:44341/_blazor/disconnect - multipart/form-data; boundary=----WebKitFormBoundaryLKTHDnNIYH3gmiLr 359
What could be the reason for this?
Description:
I have been annoyed for a while, because my log file of my Blazor application is full of the exceptions shown below. Locally on my development computer as well as on Azure. There are no visible effects, but a log file / Azure monitoring overflowing with errors is still disturbing.
Now I have finally found out when the error occurs. Every time the browser tab in which the Blazor app is running is closed. I.e. if I have the application open in 5 tabs and then close them all, I have these 3 exceptions in the log 5 times.
The problem only occurs when I am in the Blazor app, but not on the login page, which runs with MVC. However, it also occurs when I switch from the Blazor app to the profile page, which also runs with MVC.
Conclusion: As soon as I close the Blazor app in any way, I have the error in the log.
Unfortunately I haven't found a solution yet... Can this be solved by configuration? You should also have this problem, because I have generated my project with your template.
In my earlier ABP Blazor projects (ABP version 8.0.4 and 8.1.0) this problem does not exist.
Exception message and full stack trace:
2025-03-21T15:12:30.498594964Z [15:12:30 WRN] The operation was canceled.
2025-03-21T15:12:30.498626168Z System.OperationCanceledException: The operation was canceled.
2025-03-21T15:12:30.498630914Z at System.Threading.CancellationToken.ThrowOperationCanceledException()
2025-03-21T15:12:30.499695960Z at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token)
2025-03-21T15:12:30.499710156Z at Volo.Abp.Caching.DistributedCache`2.GetAsync(TCacheKey key, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)
2025-03-21T15:12:30.508186494Z [15:12:30 ERR] Error when dispatching 'OnDisconnectedAsync' on hub.
2025-03-21T15:12:30.508204006Z System.Threading.Tasks.TaskCanceledException: A task was canceled.
2025-03-21T15:12:30.508208351Z at Volo.Abp.Threading.SemaphoreSlimExtensions.LockAsync(SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken)
2025-03-21T15:12:30.508212734Z at Volo.Abp.Caching.DistributedCache`2.GetOrAddAsync(TCacheKey key, Func`1 factory, Func`1 optionsFactory, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)
2025-03-21T15:12:30.508216835Z at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributorCache.GetAsync(Guid userId, Nullable`1 tenantId)
2025-03-21T15:12:30.508220579Z at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributor.ContributeAsync(AbpClaimsPrincipalContributorContext context)
2025-03-21T15:12:30.508224471Z at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.InternalCreateAsync(AbpClaimsPrincipalFactoryOptions options, ClaimsPrincipal existsClaimsPrincipal, Boolean isDynamic)
2025-03-21T15:12:30.508228453Z at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.CreateDynamicAsync(ClaimsPrincipal existsClaimsPrincipal)
2025-03-21T15:12:30.508232343Z at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.HandleDynamicClaimsPrincipalAsync(ClaimsPrincipal claimsPrincipal, IServiceProvider serviceProvider, HubCallerContext hubCallerContext, Boolean skipCheckDynamicClaimsInterval)
2025-03-21T15:12:30.508237154Z at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.508240927Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.508259520Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.508263733Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.508267595Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.508271986Z at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
2025-03-21T15:12:30.508275817Z at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
2025-03-21T15:12:30.508279633Z at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.HubOnDisconnectedAsync(HubConnectionContext connection, Exception exception)
2025-03-21T15:12:30.509313222Z [15:12:30 ERR] Failed disposing connection RfusBEBpFoUp9uL-jjOGqQ.
2025-03-21T15:12:30.509330226Z System.Threading.Tasks.TaskCanceledException: A task was canceled.
2025-03-21T15:12:30.509609315Z at Volo.Abp.Threading.SemaphoreSlimExtensions.LockAsync(SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken)
2025-03-21T15:12:30.509620537Z at Volo.Abp.Caching.DistributedCache`2.GetOrAddAsync(TCacheKey key, Func`1 factory, Func`1 optionsFactory, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)
2025-03-21T15:12:30.509825846Z at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributorCache.GetAsync(Guid userId, Nullable`1 tenantId)
2025-03-21T15:12:30.509854785Z at Volo.Abp.Identity.IdentityDynamicClaimsPrincipalContributor.ContributeAsync(AbpClaimsPrincipalContributorContext context)
2025-03-21T15:12:30.510047633Z at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.InternalCreateAsync(AbpClaimsPrincipalFactoryOptions options, ClaimsPrincipal existsClaimsPrincipal, Boolean isDynamic)
2025-03-21T15:12:30.510056019Z at Volo.Abp.Security.Claims.AbpClaimsPrincipalFactory.CreateDynamicAsync(ClaimsPrincipal existsClaimsPrincipal)
2025-03-21T15:12:30.510059319Z at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.HandleDynamicClaimsPrincipalAsync(ClaimsPrincipal claimsPrincipal, IServiceProvider serviceProvider, HubCallerContext hubCallerContext, Boolean skipCheckDynamicClaimsInterval)
2025-03-21T15:12:30.510063008Z at Volo.Abp.AspNetCore.SignalR.Authentication.AbpAuthenticationHubFilter.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.510066606Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.510070016Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.510072984Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.510084402Z at Microsoft.AspNetCore.SignalR.Internal.HubFilterFactory.OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func`3 next)
2025-03-21T15:12:30.510087658Z at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
2025-03-21T15:12:30.510090636Z at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
2025-03-21T15:12:30.510093493Z at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.HubOnDisconnectedAsync(HubConnectionContext connection, Exception exception)
2025-03-21T15:12:30.510096451Z at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.RunHubAsync(HubConnectionContext connection)
2025-03-21T15:12:30.510099320Z at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.OnConnectedAsync(ConnectionContext connection)
2025-03-21T15:12:30.510114188Z at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.OnConnectedAsync(ConnectionContext connection)
2025-03-21T15:12:30.510118175Z at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionContext.ExecuteApplication(ConnectionDelegate connectionDelegate)
2025-03-21T15:12:30.510121767Z at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionContext.WaitOnTasks(Task applicationTask, Task transportTask, Boolean closeGracefully)
2025-03-21T15:12:30.510125314Z at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionContext.DisposeAsync(Boolean closeGracefully)
2025-03-21T15:12:30.510128896Z at Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionManager.DisposeAndRemoveAsync(HttpConnectionContext connection, Boolean closeGracefully, HttpConnectionStopStatus status)
Thanks for help, Adrian
Thanks for your feedback, I'll ask and learn why this was done like that previously, and we'll update it as you mentioned if possible in the module.
Great! Thanks.
Thanks, I have now made the following change:
// Initialize edition end date if it is not set or has expired
if (!tenant.EditionEndDateUtc.HasValue || tenant.EditionEndDateUtc.Value < DateTime.UtcNow)
{
tenant.EditionEndDateUtc = DateTime.UtcNow;
await TenantRepository.UpdateAsync(tenant);
}
Thank you for your answer @enisn.
Stripe offers different ways to upgrade, depending on the configuration. We use Stripe's customer portal, which the customer then uses to upgrade. This is also perfectly notified via the webhooks to our app and the StripePaymentGateway also handles this correctly (new edition is set to tenant). This is not the problem.
The problem is when the customer is already logged in and comes back to the page where he can choose the different subscriptions (no upgrade via our official way with the Stripe customer portal).
Can you provide me with the code for the method CreateSubscriptionAsync? Then I can overwrite it myself.
I have noticed the following problem in connection with the payment.
The following scenario:
-> Result: His previously valid subscription has been deactivated, as the EditionEndDateUtc is automatically reset when the PaymentRequest is created.
How could the problem be solved? Why is the date changed in the tenant using the SubscriptionAppService.CreateSubscriptionAsync method, even if the payment has not yet been completed and there is already a valid date in it? What is the reason for this?
var paymentRequest = await SubscriptionAppService.CreateSubscriptionAsync(editionId.Value, TenantId.Value);
await RedirectToPaymentGateway(paymentRequest.Id);
How can I reproduce this exception in the template project?
Can you share a simple project or code and steps?
Unfortunately, I can't explain how you could reproduce this (as I don't know myself where these errors are coming from). But at the moment I don't have the time to look into it. However, it seems that it still works and the end user doesn't notice anything.
Can you check your question in Chrome dev-tool?
You can consider moving the
js codeto a function(PostPaymentGatewaySelectionForm), thenInvokethis function in blazor.await JSRuntime.InvokeVoidAsync("PostPaymentGatewaySelectionForm")
Unfortunately, no success in this matter. That didn't help and I don't see anything relevant via the dev-tools either.
But generally I have exceptions of this kind again and again... but the end user doesn't notice anything.
hi
Yes, We have added
{ StripeConsts.ParameterNames.PaymentRequestId, paymentRequest.Id.ToString()}in theStartAsyncmethod just like yours.
Ok, then it should work.
Now you just have to assign the date (otherwise the method is useless). And I would not update the PaymentRequest, but solve this via the event (as before).
var paymentUpdatedEto = ObjectMapper.Map<PaymentRequest, SubscriptionUpdatedEto>(paymentRequest);
paymentUpdatedEto.PeriodEndDate = ConvertToDateTime((int)stripeEvent.Data.RawObject.current_period_end);
await EventBus.PublishAsync(paymentUpdatedEto);
Have you tested this?
It will only work if you have also adapted the StartAsync method (PaymentRequestId in the metadata of the subscription). This is because the RawObject is a subscription and not a session, as is the case with HandleCheckoutSessionCompletedAsync, for example.
In addition, the date is not assigned. And finally, you make an update to the PaymentRequest, although you have not changed anything.