Hi liangshiwei, I had already tried, I added the following reference to the .EntityFrameworkCore.Tests.csproj <PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.8" />
The missing section in dynamic-env.json was AbpAccountPublic. We solve adding the following section inside the file.
{
"production": true,
"application": {
"baseUrl":"http://localhost:4200",
"name": "App",
"logoUrl": ""
},
"oAuthConfig": {
"issuer": "https://localhost:44391/",
"redirectUri": "http://localhost:4200",
"clientId": "App_App",
"responseType": "code",
"scope": "offline_access openid profile email phone App"
},
"apis": {
"default": {
"url": "https://localhost:44391",
"rootNamespace": "App"
},
"AbpAccountPublic": {
"url": "https://localhost:44391/",
"rootNamespace": "AbpAccountPublic"
}
}
}
Hi, the problem is only on account module. The app now is deployed on nginx using the dynamic-env.json All modules are using the right endpoint apis->default->url instead the account module use the localhost.
{
"production": true,
"application": {
"baseUrl":"https://etsapp-ui-dev.mydomain.it",
"name": "App",
"logoUrl": ""
},
"oAuthConfig": {
"issuer": "https://etsapp-api-dev.mydomain.it/",
"redirectUri": "https://etsapp-ui-dev.mydomain.it",
"clientId": "App_App",
"responseType": "code",
"scope": "offline_access openid profile email phone App"
},
"apis": {
"default": {
"url": "https://etsapp-api-dev.mydomain.it",
"rootNamespace": "App"
}
}
}
Hi,
I'm writing to bring your attention to an issue with the auditing process in the Volo.Abp.Auditing module. I've observed that the auditing process does not properly support value objects, and I would like to discuss a specific problem I've encountered.
Through a test, I've identified that the error in inserting data into the EntityChanges table is due to the fact that the EntityId is null, as evidenced by the test results.
In summary, I'm raising a concern with the Volo.Abp.Auditing module, as it currently fails to track changes to the properties of value objects. This issue stems from an error in inserting data into the EntityChanges table, which does not allow null values in the EntityId column.
I would appreciate your guidance on a potential solution to this problem. Your assistance in resolving this issue would be greatly appreciated.
Hi, the unit test confirm my error: EntityId is null-
Please add the following check here on the update operation
&& !x.EntityChanges[1].EntityId.IsNullOrEmpty()
You will have the following test result:
Volo.Abp.Auditing.Auditing_Tests.Should_Write_AuditLog_For_ValueObject_Entity Source: Auditing_Tests.cs line 366 Duration: 9,8 sec Message: NSubstitute.Exceptions.ReceivedCallsException : Expected to receive a call matching: SaveAsync(x => ((((((((((x.EntityChanges.Count == 2) AndAlso (Convert(x.EntityChanges.get_Item(0).ChangeType, Int32) == 1)) AndAlso (x.EntityChanges.get_Item(0).EntityTypeFullName == Volo.Abp.Auditing.App.Entities.AppEntityWithValueObject.FullName)) AndAlso (Convert(x.EntityChanges.get_Item(1).ChangeType, Int32) == 1)) AndAlso (x.EntityChanges.get_Item(1).EntityTypeFullName == Volo.Abp.Auditing.App.Entities.AppEntityWithValueObjectAddress.FullName)) AndAlso (x.EntityChanges.get_Item(1).PropertyChanges.Count == 1)) AndAlso (x.EntityChanges.get_Item(1).PropertyChanges.get_Item(0).PropertyName == "Country")) AndAlso (x.EntityChanges.get_Item(1).PropertyChanges.get_Item(0).OriginalValue == ""England"")) AndAlso (x.EntityChanges.get_Item(1).PropertyChanges.get_Item(0).NewValue == ""Germany"")) AndAlso Not(x.EntityChanges.get_Item(1).EntityId.IsNullOrEmpty()))) Actually received no matching calls. Received 2 non-matching calls (non-matching arguments indicated with '*' characters): SaveAsync(*AUDIT LOG: [---: -------] - UserName - UserId : - - ClientIpAddress : - ExecutionDuration : 332 - Entity Changes: - [Created] Volo.Abp.Auditing.App.Entities.AppEntityWithValueObjectAddress, Id = AppEntityWithValueObjectId: -> "08d140ca-5b9f-4f28-a797-b7d3b77b1522" Country: -> "England" - [Updated] Volo.Abp.Auditing.App.Entities.AppEntityWithValueObject, Id = 08d140ca-5b9f-4f28-a797-b7d3b77b1522 Name: "test name" -> "test name 2" - [Deleted] Volo.Abp.Auditing.App.Entities.AppEntityWithValueObjectAddress, Id = AppEntityWithValueObjectId: "08d140ca-5b9f-4f28-a797-b7d3b77b1522" -> Country: "USA" -> *) SaveAsync(*AUDIT LOG: [---: -------] - UserName - UserId : - - ClientIpAddress : - ExecutionDuration : 59 - Entity Changes: - [Updated] Volo.Abp.Auditing.App.Entities.AppEntityWithValueObject, Id = 08d140ca-5b9f-4f28-a797-b7d3b77b1522 - [Updated] Volo.Abp.Auditing.App.Entities.AppEntityWithValueObjectAddress, Id = Country: "England" -> "Germany" *) Stack Trace: ReceivedCallsExceptionThrower.Throw(ICallSpecification callSpecification, IEnumerable`1 matchingCalls, IEnumerable`1 nonMatchingCalls, Quantity requiredQuantity) CheckReceivedCallsHandler.Handle(ICall call) Route.Handle(ICall call) CallRouter.Route(ICall call) CastleForwardingInterceptor.Intercept(IInvocation invocation) AbstractInvocation.Proceed() ProxyIdInterceptor.Intercept(IInvocation invocation) AbstractInvocation.Proceed() ObjectProxy.SaveAsync(AuditLogInfo auditInfo) Auditing_Tests.Should_Write_AuditLog_For_ValueObject_Entity() line 412 --- End of stack trace from previous location ---
I'm sorry. I changed the default AuthorizationEndpoint on *AppHttpApiHostModule,cs to "https://login.microsoftonline.com/common/oauth2/v2.0/authorize" for a multitenant app