Activities of "maliming"

hi

public class MyNullCancellationTokenProvider : CancellationTokenProviderBase
{
    public static NullCancellationTokenProvider Instance { get; } = new();

    public override CancellationToken Token => OverrideValue?.CancellationToken ?? CancellationToken.None;

    public MyNullCancellationTokenProvider()
        : base(new AmbientDataContextAmbientScopeProvider<CancellationTokenOverride>(new AsyncLocalAmbientDataContext()))
    {
    }
}


hi

I have pushed the code. https://github.com/perquantum/g1-health/commit/01d5a9ab6ae88f7e25ffbaf3aa5887acd08e4dbd

G1.health.IdentityService

G1.health.AuthServer:

ok, I will add code to replace the services.

Btw You can try using NullCancellationTokenProvider instead HttpContextCancellationTokenProvider to troubleshoot the A task was canceled. problem


public override void ConfigureServices(ServiceConfigurationContext context)
{
    context.Services.Replace(ServiceDescriptor.Transient<ICancellationTokenProvider, NullCancellationTokenProvider>());
        
}

But I still can see the Index page sill uses the OpenIddictProDbContext

at ESv2.Pages.IndexModel.OnGetAsync() in D:\a\Hathor\Hathor\aspnet-core\src\ESv2.AuthServer\Pages\Index.cshtml.cs:line 30

4-09-21 13:53:36.610 +00:00 [ERR] An error occurred using the connection to database 'ESv2-testing' on server 'tcp:hathor-hk.database.windows.net,1433'.
2024-09-21 13:53:36.610 +00:00 [DBG] A query was canceled for context type 'Volo.Abp.OpenIddict.EntityFrameworkCore.OpenIddictProDbContext'.
2024-09-21 13:53:36.620 +00:00 [ERR] ---------- RemoteServiceErrorInfo ----------
{
  "code": null,
  "message": "An internal error occurred during your request!",
  "details": null,
  "data": {},
  "validationErrors": null
}

2024-09-21 13:53:36.620 +00:00 [ERR] A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository`2.GetListAsync(Boolean includeDetails, CancellationToken cancellationToken)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at ESv2.Pages.IndexModel.OnGetAsync() in D:\a\Hathor\Hathor\aspnet-core\src\ESv2.AuthServer\Pages\Index.cshtml.cs:line 30

hi

I will implement these replacements. But can you make your project can be built?

Thanks

In AuthServer :
AbpUserClaimsPrincipalFactory.cs

In IdentityService :
IdentityDynamicClaimsPrincipalContributor.cs
IdentityDynamicClaimsPrincipalContributorCache.cs
IdentityUserManager.cs

Clear the Redis.

hi

I can't build your project.

Maybe we are going in the wrong direction. Is your current goal to replace UserManage with your custom service in the entire microservice?

TaskCancelledException may be the browser canceling the request.


Are you asking me to comment out again and send logs?

Yes, Please. Because I see the error caused by the Index page. so Please try to remove the db call from Index page.

hi

ActivationEndDate should have a value and >= Clock.Now

public enum TenantActivationState : byte
{
    Active = 0,

    ActiveWithLimitedTime = 1,

    Passive = 2
}


public virtual Task<bool> IsActiveAsync(Tenant tenant)
{
    return Task.FromResult(tenant.ActivationState switch
    {
        TenantActivationState.Active => true,
        TenantActivationState.Passive => false,
        TenantActivationState.ActiveWithLimitedTime => tenant.ActivationEndDate >= Clock.Now,
        _ => false
    });
}```
Showing 2911 to 2920 of 10645 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20