Activities of "richard.harrison@brightserve.com"

This issue still isn't resolved - can you provide guidance please.

That's effectively what I did to get it to run; however it would be nice to understand why SecureStorage doesn't work in a clean ABP suite generated application (8.2.2)

#define USE_PREFERENCES

using Volo.Abp.DependencyInjection;

namespace BrightServe.Maui.Shared.Storage;

public class DefaultStorage : IStorage, ITransientDependency
{
    public async Task<string> GetAsync(string key)
    {
#if USE_PREFERENCES
        return Preferences.Get(key, string.Empty);
#else
        return await SecureStorage.Default.GetAsync(key);
#endif
    }

    public async Task SetAsync(string key, string value)
    {
        if (value.IsNullOrEmpty())
        {
            await RemoveAsync(key);
            return;
        }
#if USE_PREFERENCES
        Preferences.Set(key, value);
#else
        await SecureStorage.Default.SetAsync(key, value);
#endif
    }

    public Task RemoveAsync(string key)
    {
#if USE_PREFERENCES
        Preferences.Remove(key);
#else
        SecureStorage.Default.Remove(key);
#endif
        return Task.CompletedTask;
    }
}

As for the use of AsyncHelpers.RunSync my experience is that when being called frequently (especially from methods that themselves are async) a deadlock can result. I've had this a few times both using .Result and my own code which was almost identical to what AsyncHelper.RunSync does (see https://github.com/aspnet/AspNetIdentity/blob/main/src/Microsoft.AspNet.Identity.Core/AsyncHelper.cs); however I don't think that this the cause of this problem.

Using AsyncHelper.RunAsync is possibly not a good idea as I think it could lead to deadlocks; however I cannot prove that this is happening.

The last comment in the thread https://abp.io/support/questions/6409/Mobile-MAUI-Android-Release-build-stuck-on-splash said "we'll update the template according to this information, thanks for this key point" and yet 8 months later GetClaimsPrincipal still isn't async.

After much debugging and experimentation it appears that SecureStorage is the problem; if I change the DefaultStorage.cs module to use SecureStorage instead of Preferences then the debug app also locks up; not sure why but possibly because it is called too early in the startup sequence or maybe because it is called from GetClaimsPrincipal which is not an async method and using AsyncHelper.RunSync(() => is probably not a safe way of using an async method.

I think it is therefore sensible to change GetClaimsPrincipal to be async.

I've tried on different Android versions, API 27 and API 30

we already tried that; in our LabMauiModule we #define DEBUG at the top

  • I checked the server logs and there isn't any evidence of a call to the API being made
  • we are using static proxies.
  • The crash is within a short period (probably less than a second of splash screen showing)

So I don't think this is the fixed

  • ABP Framework version: v8.1.3 / 8.2.2
  • UI Type: MAUI
  • Database System: EF Core SQL Server
  • Exception message and full stack trace:n/a
  • Steps to reproduce the issue:Start release mode app on iOS

Our application crashes on the splash screen on iOS when running in release mode. The same code works fine in debug. We've tried to match the debug/release settings in the project and it still crashes. We haven't managed to get a stack trace or any indication of what the error is.

The app runs fine in DEBUG. We've tried using all of the code that is #if DEBUG

Starting with a clean ABP.IO MAUI application built with either 8.1.3 or 8.2.2 shows the same problem.

We've tried the solution in https://abp.io/support/questions/5019/72-and-71-Maui-Android-crashes-in-Release-mode-but-works-in-Debug and we still get a crash.

App also crashes when installed via testflight. We have to use dotnet command line to build the testflight app.

I've tried creating a clean MAUI app using Visual Studio (mac) and it works until I include the ABP projects and assemblies;

We've been trying to fix this since 22/8 and are in desperate need of guidance - or how to find out what the problem actually is.

I will investigate this thanks for the link

  • ABP Framework version: v8.1.3 or 8.2.2
  • UI Type: MAUI
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Steps to reproduce the issue:
  • Visual Studio 2022
  • .NET SDK 8.0.401
  • Create new project using ABP SUITE. Run app in Release on Android emulator or Android Device; splash screen displays and app hangs; logcat shows no activity

I've tried this with both the old ABP SUITE (web based) and the new ABP suite beta app.

The requirement is that I have an entity called RateCard that is used to define pricing for a range of services. To do this the rate card has a collection of Rates (RateCardRate). Each of these has a Value for the base rate together with a set of entities (called ValueModifiers) that provide a different rate when a set of criteria are fulfilled.

I used the builder and the only way that I could find to have a entity that contains a collection of entities is with the many to many navigation property. This provides a design that is reasonably elegant; although for my purposes the linking table isn't strictly necessary because there will not be any shared data (i.e each ValueModifier is unique). However I am happy to go this way.

I can populate the data quite nicely; creating a RateCard and then creating ValueModifiers that I insert and add to the rate card.

What I am struggling with is what is the right way to navigate these properties.

What I want to do is to load a rate card which has a collection of RateCardRates and each RateCardRate has a collection of ValueModifiers that I can iterate.

What I have to do to make this work is the following (the whole test is included for clarity) - but these seems a little inelegant to have to iterate and then call the GetWithNavigationProperties; normally I'd like to be able to do all of this within a LINQ .Select statement

    public async Task ImportAsync()
    {
        var rateCardMatch = await _rateCardRepository.FindAsync(c => c.RateCardName == "Wessex Fleet");
        var rateCard = await _rateCardRepository.GetAsync(rateCardMatch.Id);
        rateCard.ShouldNotBeNull();
        var rates = await _rateCardRateRepository.GetListAsync(c => c.RateCardId == rateCard.Id);
        rates.ShouldNotBeEmpty();
        foreach (var rate in rates)
        {
            rate.ShouldNotBeNull();
            rate.ValueModifiers.ShouldNotBeNull();

            var rateDetails = await _rateCardRateRepository.GetWithNavigationPropertiesAsync(rate.Id);
            rateDetails.ShouldNotBeNull();
            rateDetails.ValueModifiers.ShouldNotBeNull();
            rateDetails.ValueModifiers.ShouldNotBeEmpty();
            foreach (var modifier in rateDetails.ValueModifiers)
            {
                var modifierDetails = await _valueModifierRepository.GetWithNavigationPropertiesAsync(modifier.Id);
                modifierDetails.ShouldNotBeNull();

                modifierDetails.Criteria.ShouldNotBeNull();
                modifierDetails.Criteria.ShouldNotBeEmpty();
            }
        }
    }

My questions are

  • am I doing the right thing
  • is there a better way of doing this
  • how can I do this using LINQ
Showing 1 to 8 of 8 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 05:21