Base solution for your next web application

Activities of "ips-ad"

..some additional findings/bugs in the tool:

  • When adding more than 3 display properties, it generates like
                                           PersonDisplayProperty = string.Format("{0} {1} {2} {3}", s1 == null || s1.Vorname == null ? "" : s1.Vorname.ToString()
                           , s1 == null || s1.Nachname == null ? "" : s1.Nachname.ToString()
                           , s1 == null || s1.ABnr == null ? "" : s1.ABnr.ToString()
                           , s1 == null || s1.VNr== null ? "" : s1.VNr.ToString()
                           ),

This fails, because string.Format takes max. 3 arguments, need to adjust it to string.Format("...", new object[]{ ...}) instead.

  • using IPSweb.Exporting; is missing in the appService
  • _personOrganizationUnitTestId = ; id is missing in generated test

No big deals, but I thought I'd share these so that you can fix it in a next version :-)

Hi,

I'm struggling with setting up two new entities correctly, e.g.:

  1. Entity A "Coworker", menu position "Root" (which is actually "main" in the json file) Main menu -> Coworkers
  2. Entity B "CoworkerOrganizationUnit" should be placed under "Coworker" Main menu -> Coworkers -> CoworkerOrganizationUnit

Entity A is fine, B is not. Both entities share the same namespace "Persons". Entity B is fullaudited and has only 2 navigation properties (lookup tables for CoworkerId and OrganizationUnitId), no other properties.

What do I have to set as custom parent menu position, tried different things like "main>coworkers", "coworkers", "main>persons>coworkers" - but all that ends in weird folder structures and/or faulty code... Using Power Tools 4.5.3.

Thanks upfront!

Hi @ismcagdas

Thanks for your reply. It's a callback from a document server returning e.g. an updated docx to our Zero backend. The document server authorizes via token, we've added in AuthConfigurer.cs:

if (bool.Parse(configuration["Documentserver:IsEnabled"]))
{
    var securityKey = new SymmetricSecurityKey(System.Text.Encoding.UTF8.GetBytes(configuration["Documentserver:CallBackSecret"]));
    authenticationBuilder.AddJwtBearer("EditorBearerToken",
        options =>
        {
            options.TokenValidationParameters = new TokenValidationParameters()
            {
                ValidateAudience = false,
                ValidateActor = false,
                ValidateIssuer = false,
                ValidateIssuerSigningKey = true,
                ValidateLifetime = false,
                IssuerSigningKey = securityKey
            };
            options.RequireHttpsMetadata = false;
            options.SaveToken = true;

            options.SecurityTokenValidators.Clear();
            options.SecurityTokenValidators.Add(new JwtSecurityTokenHandler());
        });
}

It's the only way this document server is currently able to authenticate, we don't have direct tenant and user context.

We know it from the content though, because it's referring to existing rows in our database, so we can derive tenantId and userId from there.

What we want to achieve is:

  • Flag entity history with correct tenantId and userId (-> we just solved this with IAbpSession using (_session.Use(tenantId, userId)) { ... })
  • Flag AbpAuditLog from the callback (see public async Task EditorCallbackHandler(){ ... } from above) with tenantId and userId. This is still open and we don't know how to achieve it, currently those logs are being created, but with tenantId and userId null.

Thanks again for your support!

Hi,

I just briefly wanted to inform you about a bug, the tool doubles this index on entity recreation (entity has been created just before and nothing modified):

Hi,

We're using controllers of the ControllerBase class for callback handling from external servers (like document editors returning modified documents), the controller then updates our row.

Like so:

public class DocController : ProjectControllerBase
{
    private readonly IDocRepository _docRepository;
    public DocController(IDocRepository docRepository)
    {
        _docRepository = docRepository;
    }
    
    [Authorize(AuthenticationSchemes = "EditorBearerToken")]
    [HttpPost]
    [RequestSizeLimit(100_000_000)]
    public async Task<ActionResult> EditorCallbackHandler()
    {
        // check stuff, get our row etc. ...
        await _docRepository.UpdateAsync(doc);
        return ...;
    }
}

We don't even know the TenantId from the incoming callback, but that's no problem as the callback contains our row Id in the metadata, so we can find the row to update.

An audig log entry is being generated automatically, it contains the TenantId (not sure from where, probably from the docRepository row?) and null as UserId, also Parameter and ReturnValue are empty/null.

The question now is: How can we populate UserId, Parameter and ReturnValue for the audit log? We have these infos from the callback metadata, just need a way to inject them (similar to Unit of Work, but additionally with user context).

Thank you!

...just to add an example, after upgrading from 12 to 14.0.0 the menu is "missing" due to old cache entries (not sure which ones exactly though), even after triggering the maintenance function:

As we're planning to release the update in the next days, we need a quick solution to this, otherwise our customers will throw too many support tickets at us ;-)

Hi @oguzhanagir

I tried again with "npm run create-dynamic-bundles" in the angular folder prior to publishing (we're using Docker images btw.).

But files like these still remain cached by end-user browsers, so I believe it doesn't really affect the issue with major updates..?

Maybe you could elaborate a best practice on how to upgrade Zero versions without causing broken frontends due to old files from the caches, or is there some documentation that I missed..?

Thanks!

Thanks for the hint, I tried it and got a push notification on the client side, accepted and the page reloaded. But e.g. these files are still old ones, so the cache apparently wasn't cleared (screenshot from browser network tab from just some minutes ago):

Any ideas...?

Hi,

We're currently updating our project from Zero 12 to Zero 14. The issue is now that our customers have the Zero 12 frontend in their browser caches, and during testing we found constellations where e.g. metronic-customize.min.css (and many other non-hashed files) remain in old versions from local browser caches. This results e.g. in disappearing menus and "damaged" frontends.

We've already optimized the configuration of our reverse proxy (nginx) like this:

    location / {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-real-IP $remote_addr;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
	
        proxy_pass http://zero_ngs;
    }

    # Serve critical files (e.g., index.html) without caching
    location ~* ^((\/$)|(\/account\/login.*)|(\/app\/.*|\/index\.html$)) {
	proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-real-IP $remote_addr;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
	add_header Cache-Control "no-cache, no-store, must-revalidate";
        add_header Pragma "no-cache";
        add_header Expires 0;
	
        proxy_pass http://zero_ngs;
    }

    # Cache hashed assets (e.g., JS, CSS with output hashing)
    location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|webp)$ {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-real-IP $remote_addr;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        add_header Cache-Control "public, max-age=604800, immutable";
	
        proxy_pass http://zero_ngs;
    }

So index.html is always "no-cache", resulting in all hashed files being fresh also due to ther unique names. But this doesn't work for metronic-customize.min.css etc. of course.

What do you suggest how to handle frontend caching during such Zero updates?

Thanks very much!

Hi,

We found an error in the Dockerfile.original in Zero 14.0.0 that you might want to fix :-) It still points to 8.0, but needs to point to 9.0:

FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base

WORKDIR /app
COPY . .

ENTRYPOINT ["dotnet", "IPSweb.Web.Host.dll"]

Best regards

Showing 1 to 10 of 21 entries