Base solution for your next web application

Activities of "pliaspzero"

We did that - but still not working;

Hi, we did that - but still same problem:

Hi, no - we host in Azure - Web App Services.. and did this enhancement var redisConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"]; var redisDatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId");

    if (!string.Equals(redisConnectionString, "localhost", StringComparison.OrdinalIgnoreCase))...

maybe this helps - I get this in Angualr app F12 in browser: DEBUG: scripts.c7f035c4f2b95935.js:1 Cannot start the connection using WebSockets transport. Unable to connect to the server with any of the available transports. ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client. scripts.c7f035c4f2b95935.js:1 DEBUG: scripts.c7f035c4f2b95935.js:1 Starting connection using ServerSentEvents transport polyfills.ce1ab5650c81c793.js:1 N: Unable to connect to the server with any of the available transports. ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client.

maybe it is a timezone issue?

We are currently using ASPZero with Redis configured as the SignalR backplane for our application. However, we are encountering an issue where Redis messages (published through SignalR) are not being immediately received by connected clients. Messages only appear after the page is reloaded, which suggests a potential issue with Redis and/or SignalR configuration.

Our application is deployed on Azure, and the site's timezone is set to W. Europe Standard Time. We suspect that this may be causing an issue with how SignalR and Redis interact, particularly in terms of time synchronization. We understand that Redis uses UTC for timestamps, and we believe there might be a mismatch with the timezone settings that could be affecting message delivery. Here's a summary of our setup and the issue:

Redis Connection String: Configured correctly with the Azure Redis Cache endpoint.
SignalR Configuration: We are using the Redis backplane with the AddStackExchangeRedis method.
Timezone: The site's timezone is set to W. Europe Standard Time.
Problem: Messages published to Redis (e.g., PUBLISH WFMOne.Web.Chat.SignalR.ChatHub:all "Hello from Redis!") are only visible to clients after they reload the page. We suspect this could be related to time handling, either in Redis or SignalR, or potentially the timezone mismatch.

Our steps taken:

We have confirmed that Redis is correctly receiving and publishing messages.
We checked that the connection and channel subscriptions work, but messages only appear after reloading the page.
We also ensured that the Redis time stamps are in UTC as expected, but we're unsure how this aligns with our local timezone (W. Europe Standard Time) and whether this is causing a delay or missed messages.

Could you please assist us in confirming if there is an issue with the timezone settings or Redis/SignalR configuration that could be causing this delay in message delivery? We would appreciate any guidance on how to properly handle timezones between SignalR and Redis in our setup.

Thank you in advance for your support.

ok - I've adapted like this - but seems not to work - any further ideas? For ex. when I press on "new version available" - I see it in another client only if site is reloaded - I think this should not be the behaviour - but get the message without reloading?

        var redisConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"];
        var redisDatabaseId = _appConfiguration.GetValue&lt;int&gt;("Abp:RedisCache:DatabaseId");

        if (!string.Equals(redisConnectionString, "localhost", StringComparison.OrdinalIgnoreCase))
        {
            // Parse the connection string into ConfigurationOptions
            var configurationOptions = ConfigurationOptions.Parse(redisConnectionString);
            configurationOptions.DefaultDatabase = redisDatabaseId; 
            configurationOptions.Ssl = true;
            configurationOptions.AbortOnConnectFail = false;

            // Configure SignalR with Redis backplane and set DatabaseId
            services.AddSignalR().AddStackExchangeRedis(options =>
            {
                options.Configuration = configurationOptions;
            });
        }
        else
        {
            // Use in-memory SignalR setup as a fallback if Redis isn't configured
            services.AddSignalR();
        }

no - it was localhost:4200

  • otherwise - when Redis is active?

like this? // Retrieve Redis connection string var redisConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"]; var redisDatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId");

        if (!string.Equals(redisConnectionString, "localhost", StringComparison.OrdinalIgnoreCase))
        {
            // Configure SignalR with Redis backplane and set DatabaseId
            services.AddSignalR().AddStackExchangeRedis(options =>
            {
                options.Configuration = redisConnectionString;
                options.InstanceName = "SignalRBackplane"; // Optional: Instance name for namespacing
                options.ConfigurationOptions = new StackExchange.Redis.ConfigurationOptions
                {
                    EndPoints = { redisConnectionString },
                    DefaultDatabase = redisDatabaseId,
                    Ssl = true,
                    AbortOnConnectFail = false
                };
            });
        }
        else
        {
            // Use in-memory SignalR setup as a fallback if Redis isn't configured
            services.AddSignalR();
        }

and one more question -for production deployment - function build(done) { should be used - not function buildDev(done) {

correct?

function build(done) { production = true;

fillScriptBundles();
fillStyleBundles();

var scriptTasks = createScriptBundles();
var styleTasks = createStyleBundles();

var stream = merge(scriptTasks.concat(styleTasks));

return !stream.isEmpty() ? stream : done();

}

function buildDev(done) { fillScriptBundles(); fillStyleBundles();

var scriptTasks = createScriptBundles();
var styleTasks = createStyleBundles();

console.log('Dynamic bundles are being created.');

var stream = merge(scriptTasks.concat(styleTasks));

return !stream.isEmpty() ? stream : done();

}

by the way get :

C:...e.Web.Host>npm run create-bundles npm error Missing script: "create-bundles" npm error npm error To see a list of scripts, run: npm error npm run npm error A complete log of this run can be found in: i\AppData\Local\npm-cache_logs\2024-11-14T12_26_49_894Z-debug-0.log

Showing 11 to 20 of 80 entries