Activities of "s.beckers"

Hi,

Problem solved by upgrading ABP packages to v8.1.4. Thanks!

Thanks!

Hi,

I think the following is the related code which is logging to the console: This triggers on handling an event handler:

public virtual async Task HandleEventAsync(EntityUpdatedEto<CompanyEto> eventData)
{
  ...
}

Do I need some configuration on the CompanyEto itself then?

  • ABP Framework version: v8.1.1
  • UI Type: Angular
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Steps to reproduce the issue: Since the upgrade from v7.x.x to v8.1.1 we have a lot of event handlers which are not triggering anymore. Something has changed? In our case we have the following Aggregate:
[Audited]
public class Company : FullAuditedAggregateRoot<Guid>, IMultiTenant
{
  ...
  public Company(
    Guid id,
    string name)
  {
    Id = id;
    Name = name;
  }
  ...
  public Address? Address { get; set; }
  ...
  public virtual ICollection<CompanyEmail> Emails { get; private set; } = new Collection<CompanyEmail>();
  ...
}

And the following handler:

public virtual async Task HandleEventAsync(EntityUpdatedEto<CompanyEto> eventData)
{
  ...
}

When we make an update in the Address (owned entity) or make changes to the Emails list and then updating the company by:

await _companyRepository.UpdateAsync(company);

The event handler is not triggered anymore since the upgrade to v8.1.1. Any idea why?

  • ABP Framework version: v8.1.1
  • UI Type: Angular
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: 2024-07-05 08:26:25Z [WRN] [Volo.Abp.Auditing.AuditingHelper] A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 64. Consider using ReferenceHandler.Preserve on JsonSerializerOptions to support cycles. Path: $.Entity.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Address.City. System.Text.Json.JsonException: A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 64. Consider using ReferenceHandler.Preserve on JsonSerializerOptions to support cycles. Path: $.Entity.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Emails.Company.Address.City. at System.Text.Json.ThrowHelper.ThrowJsonException_SerializerCycleDetected(Int32 maxDepth) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) ...
  • ABP Framework version: v8.1.1
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

After upgrading, the generate proxy command (@abp/ng.schematics:proxy-add) generates incorrect import statements. We're using generics in our dto's.

Hi, the same problem with my,
but I try to add a 'generator' of Nx to wrap schematic of abp,
It works fine because of ignore angular.json check.
You can ref below simple code ,thanks

import {  
  Tree,  
  moveFilesToNewDirectory,  
  generateFiles,  
  joinPathFragments,  
  visitNotIgnoredFiles,  
  ProjectConfiguration  
} from '@nrwl/devkit';  
import { wrapAngularDevkitSchematic } from '@nrwl/devkit/ngcli-adapter';  
  
export default async function (host: Tree, schema: any) {  
  let module=schema.module;  
  let application=schema.application;  
  let directory=schema.directory;  
  let projectType=schema.projectType;  
  let appPath=application;//.replace('-','\\');  
  let runAngularLibrarySchematic = wrapAngularDevkitSchematic(  
    '@abp/ng.schematics',  
    'proxy-add'  
  );  
  
  await runAngularLibrarySchematic(host, {  
    module: module,  
    source: application,  
    target: application  
  });  
  
  if(projectType==='lib'){  
    await removeProject(host,`libs\\${directory}\\${module}\\proxy\\src\\proxy`);  
    moveFilesToNewDirectory(  
      host,  
      `apps\\${appPath}\\src\\app\\proxy`,  
      `libs\\${directory}\\${module}\\proxy\\src\\proxy`  
    );  
  }  
  
  if(projectType==='app'){  
    moveFilesToNewDirectory(  
      host,  
      `apps\\${appPath}\\src\\app\\proxy`,  
      `apps\\${appPath}\\src\\app\\${module}\\proxy`  
    );  
  }  
   
  
  return () => {  
    console.log(`proxy added '${module} to ${module} success at ${application}`);  
  };  
}  
  
export function removeProject(tree: Tree, path: string) {  
  visitNotIgnoredFiles(tree, path, (file) => {  
    tree.delete(file);  
  });  
  //tree.delete(path);  
}  
  
  

I have tested the solutions is works without angular.json.
as a workaround, You can create and use your own schematic wrapper. source: https://nx.dev/plugins/recipes/local-generators

Thank you!

Any idea if this can be checked by someone? We're currently stuck upgrading ABP to version 7 since the generate-proxy command doesn't work anymore.

  • ABP Framework version: v7.1.1
  • UI type: Angular inside Nx workspace
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi,

We're getting the following error when running the abp generate-proxy command:

> abp generate-proxy -t ng -m platform --target portal-data-access -u https://localhost:44321
ABP CLI 7.1.1
angular.json file not found. You must run this command in the angular folder.

We've upgraded our Angular based Nx workspace to version 15.9.2 which included a Nx migration that removed the angular.json since it is not needed anymore in the mono repo setup. The ABP cli still seems to rely on the angular.json. Is there another option we can use in the command to bypass this error? Something like an output path of the proxy folder?

Related docs:

https://docs.abp.io/en/abp/latest/UI/Angular/Service-Proxies "The command can find application/library roots by reading the angular.json file. Make sure you have either defined your target project as the defaultProject or pass the --target parameter to the command. This also means that you may have a monorepo workspace."

Showing 1 to 10 of 15 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13