Open Closed

Chat Module added to Module Project in Web.Unified will not show menu items #4772


User avatar
0
ten3systems created
  • ABP Framework version: v6.0.2
  • UI type: MVC, module template
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:
  1. create new module from template abp new MyModule -t module-pro -d ef --dbms MySQL -v 6.0.2
  2. add chat module abp add-module Volo.Chat
  3. modify UnifiedDbContext for Web.Unified host project: modelBuilder.ConfigureChat();
  4. perform db migrations and run
  5. enable chat in tenant => manage host features

Expected result is to see the Chat menu item on the left menu and the messages waiting indicator in the top nav menu; but neither are showing and I don't know how to engage the URL to visit the chat ui page to see if it will render. I am at a loss on how to make the chat module feature work in my host project while developing my module.

Followed the instructions at https://docs.abp.io/en/commercial/6.0/modules/chat


20 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please try to add ChatPermissions.Messaging to the current user.

  • User Avatar
    0
    ten3systems created

    Thanks, all permissions are applied; there does not seem to be a ChatPermissions section

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The permission(Chat.Messaging) exists on ChatApplicationContractsModule Can you confirm that you are depending on it correctly?

  • User Avatar
    0
    ten3systems created

    Thanks, I guess the command abp add-module Volo.Chat does not add to /host/* modules, only in the /src/* modules. I still do not have access to the NAV alert indicator or the side menu item, but now at least I can see the permission for chat after having added all the depends in my Web.Unified module

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please add ChatWebModule as well. If still not working please share a project. liming.ma@volosoft.com

  • User Avatar
    0
    ten3systems created

    That produces a bundling error, even if i remove the ChatSignalRModule dependsOn

    AbpException: Could not find the bundle file '/libs/signalr/browser/signalr.js' for the bundle 'Lepton.Global'!

    The addition of ChatModule to my module project also breaks my test project; before it's fine, after, the ISettingProvider is being resolved as NULL in my service class .. so weird.

    Project is simple, might be better if you spun up a new proj within your env and add chat module to Host/MyProject.Web.Unified. That's all i did, added a new service and test to test that service. but i can still send sample if that is what you require...

    Thank-you for your assistance

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The project you shared is incomplete.

    You can add "@volo/chat": "~7.1.0" to your packages.json and run abp install-libs command.

    The project file "CustomChatBotModuleWithVolo.ChatModule/src/ten3.ChatBot.GenerateCodeFromSpecFiles.Console/ten3.ChatBot.GenerateCodeFromSpecFiles.Console.csproj" was not found.

  • User Avatar
    0
    ten3systems created

    sort of working, yay! now i can see the envelope in the upper menu; but errors with every page load:

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please remove the ChatHttpApiClientModule.

  • User Avatar
    0
    ten3systems created

    same problem:

    [23:07:13 DBG] Found in the cache: pn:R,pk:admin,n:Chat.Messaging [23:07:13 INF] Executing endpoint '/signalr-hubs/chat/negotiate' [23:07:13 INF] Executed endpoint '/signalr-hubs/chat/negotiate' [23:07:13 INF] Request finished HTTP/2 POST https://localhost:44322/signalr-hubs/chat/negotiate?negotiateVersion=1 text/plain;charset=UTF-8 0 - 200 316 application/json 45.1625ms [23:07:13 INF] Request starting HTTP/1.1 GET https://localhost:44322/signalr-hubs/chat?id=XW8bfgnfjiYqTp5yNemUTQ - - [23:07:14 DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:f279cf04-7a7d-2338-d915-3a0a2db08bdd,n:Chat.Messaging [23:07:14 DBG] Found in the cache: pn:U,pk:f279cf04-7a7d-2338-d915-3a0a2db08bdd,n:Chat.Messaging [23:07:14 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Chat.Messaging [23:07:14 DBG] Found in the cache: pn:R,pk:admin,n:Chat.Messaging [23:07:14 INF] Executing endpoint '/signalr-hubs/chat' [23:07:14 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null }

    [23:07:14 ERR] Remote service 'Chat' was not found and there is no default configuration. Volo.Abp.AbpException: Remote service 'Chat' was not found and there is no default configuration. at Volo.Abp.Http.Client.RemoteServiceConfigurationDictionary.GetConfigurationOrDefault(String name) at Volo.Abp.Http.Client.RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(String name) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Chat.Users.ClientProxies.ContactClientProxy.GetTotalUnreadMessageCountAsync() at lambda_method2536(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)

  • User Avatar
    0
    ten3systems created

    Also of concern is after adding the volo.chat module my tests stopped working b/c autofac cannot resolve IsettingRepository for ISettingProvider

    DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Volo.Abp.SettingManagement.SettingManagementStore' can be invoked with the available services and parameters: Cannot resolve parameter 'Volo.Abp.SettingManagement.ISettingRepository settingRepository' of constructor 'Void .ctor(Volo.Abp.SettingManagement.ISettingRepository, Volo.Abp.Guids.IGuidGenerator, Volo.Abp.Caching.IDistributedCache`1[Volo.Abp.SettingManagement.SettingCacheItem], Volo.Abp.Settings.ISettingDefinitionManager)'.

  • User Avatar
    0
    ten3systems created

    Derp. I commented out the wrong module; I put back into place the ChatHttpApiModule and commented out the ChatHttpApiClientModule module and I'm not receiving the error any longer but I am no longer getting the envelope in the top-menu bar.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a project with me? liming.ma@volosoft.com
    please run abp clean command to clear the project and remove the node_moduels.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share a complete runnable project. I can't build it now.

  • User Avatar
    0
    ten3systems created

    the project is runnable. the Web.Unified host project runs a full website in visual studio 2022 do you get some kind of error?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, I will check it asap.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Please use the last solution in my email.

  • User Avatar
    0
    ten3systems created

    ok thank-you adding the Pages/Chat/Components/MessagesToolbarItem/Default.cshtml allows to see the envelope and link to the chat page; after adding users manually to the database (there appears to be no manager class or application service to manage contacts) then I can send messages to users!

    Only problem is now since adding Volo.Chat module SettingsProvider cannot be resolved by DI I think something about the newly included modules is causing issue because works fine without it. Try to get SampleAppService to use ISettingProvider via DI to get any setting from configuration. it will result in error:

       Source: SampleAppService_Tests.cs line 17
       Duration: 1 sec
    
      Message: 
    Autofac.Core.DependencyResolutionException : An exception was thrown while activating Volo.Abp.Settings.DefaultValueSettingValueProvider -> Volo.Abp.SettingManagement.SettingStore -> Volo.Abp.SettingManagement.SettingManagementStore.
    ---- Autofac.Core.DependencyResolutionException : None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Volo.Abp.SettingManagement.SettingManagementStore' can be invoked with the available services and parameters:
    Cannot resolve parameter 'Volo.Abp.SettingManagement.ISettingRepository settingRepository' of constructor 'Void .ctor(Volo.Abp.SettingManagement.ISettingRepository, Volo.Abp.Guids.IGuidGenerator, Volo.Abp.Caching.IDistributedCache`1[Volo.Abp.SettingManagement.SettingCacheItem], Volo.Abp.Settings.ISettingDefinitionManager)'.
    
      Stack Trace: 
      You may need to build and run this test to see links to source files in the stack trace.
    ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    <>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
    ResolvePipeline.Invoke(ResolveRequestContext ctxt)
    RegistrationPipelineInvokeMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    &lt;&gt;c__DisplayClass14_0.&lt;BuildPipeline&gt;b__1(ResolveRequestContext ctxt)
    SharingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    <>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
    <>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
    CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    &lt;&gt;c__DisplayClass14_0.&lt;BuildPipeline&gt;b__1(ResolveRequestContext ctxt)
    ResolvePipeline.Invoke(ResolveRequestContext ctxt)
    ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request)
    ResolveOperation.ExecuteOperation(ResolveRequest request)
    ResolveOperation.Execute(ResolveRequest request)
    LifetimeScope.ResolveComponent(ResolveRequest request)
    ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
    ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
    ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters)
    ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
    AutofacServiceProvider.GetRequiredService(Type serviceType)
    ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
    <.ctor>b__1(Type type)
    SelectIListIterator`2.ToList()
    Enumerable.ToList[TSource](IEnumerable`1 source)
    <.ctor>b__0()
    Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
    Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
    Lazy`1.CreateValue()
    Lazy`1.get_Value()
    SettingValueProviderManager.get_Providers()
    SettingProvider.GetOrNullAsync(String name)
    SampleAppService.GetAsync()
    AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
    CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
    GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
    CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
    AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
    CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
    AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
    CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
    AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
    CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
    ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
    CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
    AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
    CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
    AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
    AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper, IUnitOfWorkManager unitOfWorkManager)
    AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper, IUnitOfWorkManager unitOfWorkManager)
    AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
    CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
    AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
    CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
    UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
    CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
    SampleAppService_Tests.GetAsync() line 19
    --- End of stack trace from previous location ---
    ----- Inner Stack Trace -----
    &lt;&gt;c__DisplayClass12_0.&lt;UseSingleConstructorActivation&gt;b__0(ResolveRequestContext ctxt, Action`1 next)
    DelegateMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    &lt;&gt;c__DisplayClass14_0.&lt;BuildPipeline&gt;b__1(ResolveRequestContext ctxt)
    DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    <>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
    <>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext ctxt, Action`1 next)
    DelegateMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    <>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
    <>c__DisplayClass8_0`3.&lt;EnableInterfaceInterceptors&gt;b__1(ResolveRequestContext ctxt, Action`1 next)
    DelegateMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    &lt;&gt;c__DisplayClass14_0.&lt;BuildPipeline&gt;b__1(ResolveRequestContext ctxt)
    ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
    
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Cannot resolve parameter 'Volo.Abp.SettingManagement.ISettingRepository settingRepository'

    You need to depends on the AbpSettingManagementEntityFrameworkCoreModule

  • User Avatar
    0
    ten3systems created

    Thank-you, this resolves the final problem 😍

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07