Messages multiply in queues (part II)

          Hi @cressie176,

after some time I have the same problem in production environment.
This is the actual configuration (extracted, I included only one queue)
{
    "vhosts": {
        "v0": {
            "concurrency": 30,
            "connection": {
                "url": "amqp://username:password@rabbitmq.mydomain.com:5672/?heartbeat=30",
                "socketOptions": {
                    "timeout": 10000
                }
            },
            "exchanges": {
                "amq.topic": {
                    "type": "topic",
                    "assert": false,
                    "check": true,
                    "options": {
                        "durable": true
                    }
                }
            },
            "queues": {
                "my_queue": {
                    "assert": true,
                    "check": true,
                    "options": {
                        "durable": false,
                        "deadLetterExchange": "dead_letters",
                        "deadLetterRoutingKey": "service.dead_letter"
                    }
                }
            },
            "bindings": {
                "my_queue": {
                    "source": "amq.topic",
                    "destination": "my_queue",
                    "destinationType": "queue",
                    "bindingKeys": [
                        "my_queue.my_software.created",
                        "my_queue.my_software.updated",
                        "my_queue.my_software.deleted"
                    ]
                }
            },
            "subscriptions": {
                "my_queue": {
                    "queue": "my_queue"
                }
            }
        },
        "dlq": {
            "connection": {
                "url": "amqp://username:password@rabbitmq.mydomain.com:5672/?heartbeat=30",
                "socketOptions": {
                    "timeout": 10000
                }
            },
            "exchanges": {
                "dead_letters": {
                    "assert": true
                }
            },
            "queues": {
                "dead_letters_service_queue": {
                    "assert": true
                }
            },
            "bindings": {
                "dead_letters_service": {
                    "source": "dead_letters",
                    "destination": "dead_letters_service_queue",
                    "destinationType": "queue",
                    "bindingKeys": [
                        "service.dead_letter"
                    ]
                }
            },
            "subscriptions": {
                "dead_letters_service_queue": {
                    "queue": "dead_letters_service_queue"
                }
            }
        }
    }
}

And this is the application
Rascal.Broker.create(Rascal.withDefaultConfig(this.config), function (err, broker) {
            if (err) {
                logger.error(`[BC] Rascal.Broker.create error: ${err}`)
                process.exit(1);
            }

            broker
                .on('error', (error, {vhost, connectionUrl}) => {
                    logger.error(`[BC] Broker error!!! Vhost: ${vhost} - ConnectionUrl: ${connectionUrl} - Message: ${error.message}`)
                })
                .on('vhost_initialised', ({vhost, connectionUrl}) => {
                    logger.debug(`[BC] Vhost: ${vhost} was initialised using connection: ${connectionUrl}`)
                })
                .on('blocked', ({vhost, connectionUrl}) => {
                    logger.debug(`[BC] Vhost: ${vhost} was blocked using connection: ${connectionUrl}`)
                })
                .on('unblocked', ({vhost, connectionUrl}) => {
                    logger.debug(`[BC] Vhost: ${vhost} was unblocked using connection: ${connectionUrl}`)
                })

            logger.info('Broker Initialized. Now initializing Subscriptions...')

            _.each(self.subscriptionNames, function (subscriptionName) {

                logger.debug(`Initializing Subscription "${subscriptionName}"`)

                let handler = require('./lib/handlers/_handler')(broker)

                broker.subscribe(subscriptionName, {prefetch: 10}, function (err, subscription) {
                    if (err) {
                        logger.error(`[BS] Rascal.Broker.subscribe error: ${err}`)
                        process.exit(1);
                    }

                    logger.debug(`Subscription "${subscriptionName}" initialized.`)

                    subscription
                        .on('message', function (message, content, ackOrNack) {
                            handler(message, content, subscriptionName, self.retryConfig.retry, function (err) {
                                if (!err) return ackOrNack()
                                logger.debug(`End of retries for message "${message.properties.messageId}". Now republish or DLQ.`)
                                ackOrNack(err, self.retryConfig.rascal.default)
                            })
                        })
                        .on('invalid_content', function (err, message, ackOrNack) {
                            logger.error('Invalid Content - Message: ' + err.message)
                            ackOrNack(err, broker.config.rascal.dead_letter)
                        })
                        .on('redeliveries_exceeded', function (err, message, ackOrNack) {
                            logger.error('Redeliveries Exceeded - Message: ' + err.message)
                            ackOrNack(err, broker.config.rascal.dead_letter)
                        })
                        .on('cancel', function (err) {
                            logger.error(`[SC] Subscription cancel!!! Subscription: ${subscriptionName} - Message: ${err.message}`)
                        })
                        .on('error', function (err) {
                            logger.error(`[SE] Subscription error!!! Subscription: ${subscriptionName} - Message: ${err.message}`)
                        })
                })

            })

        })

Inside RabbitMQ I have many queues, each queue has N consumer.
For the queue with the problem I had only 1 consumer with constant increase of messages inside the queue.

Some logs
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: Message:
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: {"fields":{"consumerTag":"PROD.52073b331311af77169d5febe0c252a2","deliveryTag":19161,"redelivered":false,"exchange":"amq.topic","routingKey":"my_queue.my_software.created"},"properties":{"contentType":"application/json","headers":{"dpa":{"errors":21,"runnerUrl":"https://mysoftware.mydomain.com/ws/v1/message/handle","lastErrorMessage":"getaddrinfo ENOTFOUND mysoftware.mydomain.com"},"rascal":{"originalQueue":"dead_letters_service_queue","originalVhost":"dlq","redeliveries":0,"recovery":{"my_queue":{"republished":21,"immediateNack":true}},"originalExchange":"amq.topic","originalRoutingKey":"my_queue.my_software.created","error":{"message":"getaddrinfo ENOTFOUND mysoftware.mydomain.com"},"restoreRoutingHeaders":true},"x-death":[{"count":1,"reason":"rejected","queue":"my_queue","time":{"!":"timestamp","value":1693811615},"exchange":"","routing-keys":["my_queue"]}],"x-first-death-exchange":"","x-first-death-queue":"my_queue","x-first-death-reason":"rejected"},"deliveryMode":2,"messageId":"5e226d4d-fff6-4916-a0a5-4bed9e9a3d4b"},"content":{"type":"Buffer","data":[123,34,114,111,117,125]}}
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: Content:
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: {"routingKey":"my_queue.my_software.created","type":"event","module":"module://my_software","event":"my_queue.my_software.created","data":{"model":"my_model"}}
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: [5e226d4d-fff6-4916-a0a5-4bed9e9a3d4b] MESSAGE LOST!!!
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: [5e226d4d-fff6-4916-a0a5-4bed9e9a3d4b] Content: {"routingKey":"my_queue.my_software.created","type":"event","module":"module://my_software","event":"my_queue.my_software.created","data":{"model":"my_model"}}
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: [5e226d4d-fff6-4916-a0a5-4bed9e9a3d4b] Headers: {"dpa":{"errors":21,"runnerUrl":"https://mysoftware.mydomain.com/ws/v1/message/handle","lastErrorMessage":"getaddrinfo ENOTFOUND mysoftware.mydomain.com"},"rascal":{"originalQueue":"dead_letters_service_queue","originalVhost":"dlq","redeliveries":0,"recovery":{"my_queue":{"republished":21,"immediateNack":true}},"originalExchange":"amq.topic","originalRoutingKey":"my_queue.my_software.created","error":{"message":"getaddrinfo ENOTFOUND mysoftware.mydomain.com"},"restoreRoutingHeaders":true},"x-death":[{"count":1,"reason":"rejected","queue":"my_queue","time":{"!":"timestamp","value":1693811615},"exchange":"","routing-keys":["my_queue"]}],"x-first-death-exchange":"","x-first-death-queue":"my_queue","x-first-death-reason":"rejected"}
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: [5e226d4d-fff6-4916-a0a5-4bed9e9a3d4b] Errors #21 on "https://mysoftware.mydomain.com/ws/v1/message/handle"
2023-09-04T07:13:35.219Z [debug] [PID: 3921]: [5e226d4d-fff6-4916-a0a5-4bed9e9a3d4b] Last Error Message: getaddrinfo ENOTFOUND mysoftware.mydomain.com

Finally, this is the handler function
function (broker) {
    return async function (message, content, subscriptionName, retryConfig, cb) {

        let operation = retry.operation(retryConfig)
        operation.attempt(async function (currentAttemp) {

            try {
                await runner.post('url', content)
                return cb()

            } catch (e) {

                if (operation.retry(e)) {
                    logger.debug(`Now retry. Attemp #${currentAttemp}/${retryConfig.retries} for message "${message.properties.messageId}"`)
                    return
                }

                message.properties.headers.dpa = message.properties.headers.dpa || {}
                message.properties.headers.dpa.errors = message.properties.headers.dpa.errors || 0
                message.properties.headers.dpa.errors++
                message.properties.headers.dpa.runnerUrl = 'url'
                message.properties.headers.dpa.lastErrorMessage = e.message

                cb(e)
            }
        })

    }
}

Any ideas?
Thanks.
Originally posted by @nico3dfx in https://github.com/onebeyond/rascal/issues/216#issuecomment-1705138726

Sorry @nico3dfx, I didn't spot your comment back from the 4th Sept. I'll take a look as soon as I can

After a quick glance there are something things I don't understand about your handler...

It takes the broker as an argument but doesn't use it
It appears to use a third party lib to do retries, but because the function body is in a try / catch block, this would only ever work if the body of the catch block, or the code following cb(err) threw an error
What is your rascal recovery configuration?

One scenario that would explain the duplicate messages is...

The application attempts to POST to the URL
The POST fails due to the DNS error
The rascal recovery logic republishes the message to the original queue
An error occurs after the message is republished
The 3rd party retry handler catches the error and retries from 1

Another potential issue is that you are mixing async and calllbacks
try {
  // ...
  return cb()
} catch (e) {
  // If code within the success callback throws you will end up here
  cb(e)
}

{
  "dpa":{
    "errors":21,
    "runnerUrl":"https://mysoftware.mydomain.com/ws/v1/message/handle",
    "lastErrorMessage":"getaddrinfo ENOTFOUND mysoftware.mydomain.com"
  },
  "rascal":{
    "originalQueue":"dead_letters_service_queue",
    "originalVhost":"dlq",
    "redeliveries":0,
    "recovery":{
      "my_queue":{
        "republished":21,
        "immediateNack":true
      }
    },
    "originalExchange":"amq.topic",
    "originalRoutingKey":"my_queue.my_software.created",
    "error":{
      "message":"getaddrinfo ENOTFOUND mysoftware.mydomain.com"
    },
    "restoreRoutingHeaders":true
  },
  "x-death":[
    {
      "count":1,
      "reason":"rejected",
      "queue":"my_queue",
      "time":{
        "!":"timestamp",
        "value":1693811615
      },
      "exchange":"",
      "routing-keys":[
        "my_queue"
      ]
    }
  ],
  "x-first-death-exchange":"",
  "x-first-death-queue":"my_queue",
  "x-first-death-reason":"rejected"
}

Interesting that the dpa errors and the rascal republishes are the same (21). This suggests the same message has been around the loop 21 times. The original queue is the dead_letters_service_queue suggesting it has been consumed from this queue by the application, failed, and then republished. Are you sure this queue doesn't accidentally have a consumer, potentially setup by a default subscriber?

If dead_letters_service_queue has consumers you may want to swap your _.each loop for broker.subscribeAll explicitly excluding any auto created subscriptions
try {
  const subscriptions = await broker.subscribeAll(s => !s.autoCreated) => {
  subscriptions.forEach(subscription => {
    subscription.on('message', (message, content, ackOrNack) => {
      // Do stuff with message
    }).on('error', (err) => {
      console.error('Subscriber error', err)
    }) // and so on
  });
} catch(err) {
  // One or more subscriptions didn't exist
}

Looking at your subscription event handlers, I notice you are handling the redeliveries_exceeded event. Out of curiosity, what counter implementation are you using? If you have the opportunity to use quorum queues (available from RabbitMQ 3.8.0 onwards) this would be preferable

After a quick glance there are somethings I would like to understand...

The handler takes the broker as an argument but doesn't use it (probably not related, but I wanted to check the example code is representative)

I confirm, the broker is never used and can be removed.

Are you filtering out the default subscriptions prior to the _.each loop. One is created automatically per queue? (I know we discussed this before, but worth double checking)

No filter is applied prior the _.each loop. Inside self.subscriptionNames there are all the subscriptions inside the config file (my_queue in the example)

~It appears to use a third party lib to do retries, but because the function body is in a try / catch block, this would only ever work if the body of the catch block, or the code following cb(err) threw an error~
Ignore me! I had missed the operation.retry(e) line

Ok

What is your rascal recovery configuration?

Here:
    {
        default: [
            {
                strategy: 'republish', defer: 60000, attempts: 20, xDeathFix: true
            },
            {
                strategy: 'republish', immediateNack: true,
            }
        ],
        dead_letter: [
            {
                strategy: 'republish',
                immediateNack: true,
            }
        ]
    }

Why aren't we seeing logs like Now retry. Attemp #1/20 for message "5e226d4d-fff6-4916-a0a5-4bed9e9a3d4b"

I removed it from the log but I have

Where is the "MESSAGE LOST" coming from?

From the DLQ handler. When a message is lost after the recovery strategy, it will be worked by a dlq handler that consume the message sending it to a log application with a http request

What version of retry are you using?

Latest version: 0.13.1

What is your retry configuration?

Here:
    {
        retries: 3,
        factor: 1,
        minTimeout: 5000,
        maxTimeout: 10000,
        randomize: true,
    }

Can you try to reproduce the error by calling runner.post with a non-existent domain after enabling the rascal debug (DEBUG=rascal:*) and share the sanitised logs please?

Interesting that the dpa errors and the rascal republishes are the same (21). This suggests the same message has been around the loop 21 times by this point. Rascal's originalQueue header is dead_letters_service_queue meaning it has been consumed from this dead letter queue by the application, failed, and then republished. Are you sure this queue doesn't accidentally have a consumer, potentially setup by a default subscription?

The queue has 1 consumer. In the _.each loop self.subscriptionNames contains dead_letters_service_queue

I'm less familiar with shovels, but is it possible you previously setup a shovel to move messages from the DLQ to the work queue and left it running?

No

The queue has 1 consumer. In the _.each loop self.subscriptionNames contains dead_letters_service_queue

Do you have a special handler for the dead_letters_service_queue or is it using the same handler as the service queue?

The queue has 1 consumer. In the _.each loop self.subscriptionNames contains dead_letters_service_queue

~Do you have a special handler for the dead_letters_service_queue or is it using the same handler as the service queue?~

How do you select the correct handler for the queue?

I have a config that get the handler from it.

Can you share the dead letter handler code please?

Here:
const logger = require('../logger')
const runner = require('../runner')
const _ = require("lodash")

module.exports = function (broker, handlerOptions) {
    return async function (message, content, subscriptionName, retryConfig, cb) {

        logger.debug('Message:')
        logger.debug(JSON.stringify(message))
        logger.debug('Content:')
        logger.debug(JSON.stringify(content))

        message.properties.headers.dpa = message.properties.headers.dpa || {}

        logger.debug(`[${message.properties.messageId}] MESSAGE LOST!!!`)
        logger.debug(`[${message.properties.messageId}] Content: ${JSON.stringify(content)}`)
        logger.debug(`[${message.properties.messageId}] Headers: ${JSON.stringify(message.properties.headers)}`)
        logger.debug(`[${message.properties.messageId}] Errors #${message.properties.headers.dpa.errors} on "${message.properties.headers.dpa.runnerUrl}"`)
        logger.debug(`[${message.properties.messageId}] Last Error Message: ${message.properties.headers.dpa.lastErrorMessage}`)

        let body = {
            dpa: {
                errors: message.properties.headers.dpa.errors,
                runnerUrl: message.properties.headers.dpa.runnerUrl,
                lastErrorMessage: message.properties.headers.dpa.lastErrorMessage,
            },
            content: content
        }

        try {

            await runner.post(process.env.DLQ_RUNNER_URL, body)

        } catch (e) {
            logger.error(`DLQ POST Error on "${process.env.DLQ_RUNNER_URL}"`)
        }

        return cb()

    }
}

Thanks for all the responses. I have something running locally now, and it's working as you would expect...

Receive message on service queue
Simulate persistent DNS failure / retry 20 times
Republish message to service queue if <= 20 attempts after a short delay (goto 1)
Republish message to DLQ if > 20 attempts
Receive message from DLQ
Log dead lettered message

I assume it is the service_queue where you are seeing the duplicate messages. This is the code which attempts to recover errors by republishing the message to their original queue. As you can see, the publish code defers to amqplib's publish method, and nacks the original on error, or acks it on success. If the subscriber channel closed, or your application crashed between the publish and the ack/nack the original, it would result in a duplicate message, but I assume you would have seen this. If the ack or nack yielded an error*, it would have been eventually emitted as an error, and again you would have noticed.
There are two cases I can see where ack/nack might fail and without yielding an error, potentially causing a duplicate, however I would expect you to have noticed both...

The amqp protocol does not reply to ack or nacks and consequently the amqplib methods for these functions do not accept callbacks or yield a promise. They are essentially "fire and forget". If the command never reaches the broker, the message will not be removed from the queue, and amqplib/rascal will be none the wiser. This would result in a prefetch allocation being until the delivery acknowledgement timeout was exceeded. This defaults to 30 minutes, so it would take a very long time to build up that amount of duplicates.

If the subscriber channel was closed. In nack's case the message would be rolled back, creating a duplicate and the nack error is swallowed by rascal (I will think of how to improve this), however the original error would still have been reported. In acks case the ack error should have been reported

Hi @nico3dfx,
I've gone through the rascal code again. This is the most relevant snippet...
const nackMessage = (err) => {
  session._nack(message, (_nackErr) => {
    // nackError just means the channel was already closed meaning the original message would have been rolled back
    once(err);
  });
};

if (err) return nackMessage(err);

if (!publisherChannel) return nackMessage(new Error('Unable to handle subscriber error by republishing. The VHost is shutting down'));

publisherChannel.on('error', (err) => {
  nackMessage(err);
});
publisherChannel.on('return', () => {
  nackMessage(new Error(format('Message: %s was republished to queue: %s, but was returned', message.properties.messageId, originalQueue)));
});

publisherChannel.publish(undefined, originalQueue, message.content, publishOptions, (err) => {
  if (err) return nackMessage(err); // Channel will already be closed, reclosing will trigger an error

  publisherChannel.close();

  debug('Message: %s was republished to queue: %s %d times', message.properties.messageId, originalQueue, republished + 1);
  session._ack(message, (err) => {
    once(err, true);
  });
});

The calls which interact with RabbitMQ are where it

acknowledges a message (session._ack)
rejects a message (session._nack)
publishes a message (publisherChannel.publish)

The code never specifies a requeue, so rejecting will move a message to the DLQ. You said the duplicates appear on the work queue, so we can ignore calls to session._nack
This leaves the publish and the acknowledgement. If the cloned message was republished but the original message not acknowledged, the original would stay in an unacknowledged state, using up a prefetch slot. Depending on your RabbitMQ configuration it can eventually time out and be rolled back to the work queue creating a duplicate. However, I don't see anything which could go wrong between the publish and acknowledgement without an error being reported and/or the original message rejected. The failure scenarios between the publish and the acknowledgement are

publish callback yields an error - original is rejected
publisher channel emits an error on close - highly unlikely since we just used the channel, but the original would be rejected anyway
republished message is unroutable - highly unlikely since it is being republished directly to the queue we just read it from, but the original would be rejected anyway
any other publisher channel error - the original is rejected
a subscriber channel error preventing the acknowledgement - this would cause a duplicate, and Rascal would auto-resubscribe, but still report the error. I expect you to have noticed ~1M errors.

Another possibility is that the application crashes (possibly due to a poison message) at just the point between the publish and acknowledgement. The application would need to be configured to auto-restart, and I expect you to have noticed ~1M restarts.
The last possibility I considered is if the above republish code was called repeatedly. Even if this were possible (rascal reports repeat calls to ackOrNack) the original message would have been acknowledged or rejected repeatedly, resulting in a PRECONDITION_FAILED - unknown delivery tag error.  Again, I expect you to have noticed ~1M of these.
I've found no indication that this is a bug with Rascal, and it's even less likely to be a bug with lodash.once (which Rascal uses to prevent multiple error / close events causing repeated code invocations) or async.eachSeries (which Rascal uses to loop through the recovery strategies).
Have you found anything on your side?

Hi @cressie176 ,
unfortunately I don't find the reason to reproduce the error.
I'm working to split the configuration for each customer and to an alert application that check and notify if more than N messages inside the queues.

Hi @nico3dfx,
I've released a patch version of Rascal (17.0.1) with reworked code in the republish and forward recovery strategies. It removes a couple of extremely rare corner cases which could cause an individual duplicate message (e.g. getting multiple error events while republishing the original message), but nothing which would have caused what you are seeing.
OK to close this issue again? I still can't see anything in Rascal which would cause multiple duplicates to be created and have been unable to reproduce.


New frontend web client

New client is written using rust and compiled to web asm using trunk.
See #459 #522 and #549 for more details.
fixes #261

Hey @invernizzi , could you take a look at the *.scss and *.html file? It looks good to me, but I don't know what idiomatic SCSS and HTML should look like. You can also do an end-to-end test with the following commands:
cargo xtask applet rust hello runner host --no-default-features --web --log=info
cargo xtask applet rust button_abort runner host --no-default-features --web --log=info
cargo xtask applet rust panic runner host --no-default-features --web --log=info

Actually, let me merge this because I'm going to do some changes that conflict, and the PR is good enough to merge, we can always address comments in follow-up PRs (like for the verbose logging).


How can I add the logs for start and end of every function and the time for which a function runs if I am using  before every function (hashtag569)

eg:

def area():
 a=s*s
  return a

def perimeter():
  p=s*4
  return p
if __name__ == "__main__":
        logger.remove()
        logger.add("Output/file.log", format="{time:YYYY-MM-DD at HH:mm:ss} | {level} | {message}")
        perimeter()
        area()

Hi.
Please, take a look at these examples in the documentation and let me know if it solves your problem: [Logging entry and exit of functions with a decorator](
There is no "built-in way" to log elapsed time of a function but such decorator can be easily created manually.


Rename OPENSSL_CTX prefix to OSSL_CTX

For an explanation, see pull request #12621.

I force-pushed a fix, because I forgot about the corresponding renamings of prefixes in small letters. Here is the updated script.
#!/bin/bash

set -o errexit

# this script looks more complicated as it is, because it does some
# parameter checking and it can be rerun several times.
#
# The actual renaming consists of only the last four lines of code.
#
# Every time the script is run it will redo the changes at the current
# tip of the master branch.

FROM=$1
TO=$2

function usage () {
	cat  >& 2 <<EOF
usage: one of the following two commands
    ./rename-prefix OPENSSL_CTX OSSL_CTX
    ./rename-prefix OPENSSL_CTX OSSL_CONTEXT
EOF
	exit 1
}

case $FROM in
	OPENSSL_CTX)
		;;
	*)
		usage
		;;
esac

# add necessary padding manually (I had no ambitions to figure out the magic bash string calculations)
case $TO in
	OSSL_CTX)
		from_pad=''
		to_pad='   '
	;;
	OSSL_CONTEXT)
		from_pad=' '
		to_pad=''
		;;
	*)
		usage
esac

from=${FROM,,}
to=${TO,,}

branch=pr-rename-$FROM-to-$TO

# reuse existing branch or create a new one if it does not exist yet
if git show-ref --verify --quiet refs/heads/$branch; then
	git checkout $branch
	git reset --hard master
else
	git checkout -b $branch master
fi

#
# the renaming starts here
#

# treat util/libcrypto.num and util/other.syms specially, to get the alignment correct
git grep -l ${FROM} -- util/ | xargs sed -i -E "s/${FROM}([a-zA-Z0-9_]*)${from_pad}/${TO}\1${to_pad}/g"

# treat util/libcrypto.num and util/other.syms specially, to get the alignment right
git grep -il ${FROM} | xargs sed -i "s/${FROM}/${TO}/g;s/${from}/${to}/g"

# rename the only file which contains '${FROM}' in its file name
git mv doc/man3/${FROM}.pod doc/man3/OSSL_CTX.pod

# commit the changes
git commit -a -m "Rename ${FROM} prefix to ${TO}"

Indentation issues, I doubt I flagged them all.

Hmmm... those issues appeared only after I added the renaming of the lower case prefixes. Never mind, if there are not too many of them, I could collect them in a fixup patch which can be applied automatically and (hopefully) without conflicts.

Rewrapping shorter lines isn't a style break.

Does this comment, together with your choice of reviewing #12622 (instead of #12621) already indicate a preference?

Closing in favour of #12621 (which happens to be a palindrome).


Default branch cache is not available to other branches

It seems a job ran on a new feature branch always created its own cache, even when a cache saved for the default branch existed. See for example this run.
This behavior is different from that of the actions/cache action, in which "The default branch cache is available to other branches" (see its doc on cache scopes).

Thank you for your report.
I would like to keep the behavior as close as possible to those of official actions, but there appears to be no API in the @actions/cache package to change this behavior. I have also checked the source code of actions/cache, but could not find anything special about it. So, I do not know why this difference occurs and cannot address it at this time.
Could there be some other condition involved? (e.g., cache and branch creation time, workflow permissions, etc)

@muzimuzhi The default branch of your repository is develop, and the cache list shows that no cache is stored for this branch; the main branch certainly has a cache entry, but not the default.
Maybe this is the cause? (unless you have changed the default branch or deleted caches on develop)

@muzimuzhi The default branch of your repository is develop, and the cache list shows that no cache is stored for this branch; the main branch certainly has a cache entry, but is not the default.

Oh my. Thank you very much for pointing out this subtle difference as I seldom change default branch in forks. Thanks again and sorry for the noise.


Printing the command line breaks ps-1

Not an issue per se but perhaps theres' an easy fix
Instead of
(⎈ |eu-1:default)➜  ~

You'll see
(⎈ |+ kubectl config current-context
eu-1:+ kubectl config view --minify --output jsonpath={..namespace})➜  ~

have you seen #23?

@ahmetb nope, but looks like dupe, closing. Thanks :)


Dimmer state for RGB devices

Implement a virtual state with the level role, that is used as a factor for "dimming" rgb devices.
Color values are calculated by multiplying them with the "dimming" state divided by 100.

closing in favor of #12

closing in favor of #12


The link of LV-ViT pre-trained model with resolution 448 is broken, could you please update it?

Updated, thanks for reporting the issue!


update environment to use latest current versions

This is only the conda part. I want to see whether this passes. If yes, I can also adjust the requirements.txt part.

The tests fail with:
+ snakemake --cores 1 --snakefile test/Snakefile
26
Traceback (most recent call last):
27
  File "/opt/hostedtoolcache/Python/3.11.8/x64/bin/snakemake", line 8, in <module>
28
    sys.exit(main())
29
             ^^^^^^
30
  File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/snakemake/__init__.py", line 2631, in main
31
    parser = get_argument_parser()
32
             ^^^^^^^^^^^^^^^^^^^^^
33
  File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/snakemake/__init__.py", line 1545, in get_argument_parser
34
    lp_solvers = pulp.list_solvers(onlyAvailable=True)
35
                 ^^^^^^^^^^^^^^^^^
36
AttributeError: module 'pulp' has no attribute 'list_solvers'. Did you mean: 'listSolvers'?
37
Error: Process completed with exit code 1.

The pulp pin is a workaround for https://github.com/snakemake/snakemake/issues/2607


Fix js error inside talk voting

With the templates having been rewritten for ep2019, this is no longer an issue.


UARTs available in ESP32-WROVER-E (and related GPIO pins) (IDFGH-5161)

Hello,
We are starting a project using a ESP32-WROVER-E module and we would like to know how many UARTs are available and which pins can be used for that.
After looking the datasheet it seems that there is only one UART available (the UART 0) but I'm pretty sure that two other ones (as it seems looking at esp32 chip datasheet ) must be available:

In some forums we have seen that ANY GPIO can be used as a UART pin. Is that true? Is there no limitations?
And how it has to be configured? Just using uart_set_pin function?
Lot of thanks,
Carles

Yes using uart_set_pin almost any gpio are usable
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/gpio.html

Thanks @negativekelvin
And so, 3 UARTs can be used, right?

There are three UARTs they are all useable. However unlike other microcontrollers there are some limitations. I recommend checking out technical reference manual to make sure your design will work seamlessly. Here are some issue we have come across.
https://github.com/espressif/esp-idf/issues/2317 https://github.com/espressif/esp-idf/issues/6152 https://github.com/espressif/esp-idf/issues/6186
General questions like this are better suited to the esp32 forums.

Thanks @AshUK .
We have already check the technical reference manual but we are not quite sure which are the recommended pins as in the ESP-WROVER-E Datasheet just the UART 0 is documented:

Thanks

@carlessole its in Table 1: Pin Description, labeled; U0RXD, U0TXD, U1RXD, U1TXD, U2RXD, U2TXD.

@AshUK, which document are you talking about? I am looking at ESP-WROVER-E Datasheet
And there, I think Pin Description is in table 3:

And there is nothing about U1RXD, U1TXD, U2RXD, U2TXD. There just appear U0RXD, U0TXD:

@carlessole you are right it is no included probably for verbosity. its in the ESP-32 Data sheet.
Section 12.1 of the WROVER-E data sheet has a list of must read documents. I highly recommend reading through all the documents and resources.

If the pin you wish to use is not expose by the module you can use IO multiplexing to assign it to any pin. This is explain in the ESP-32 TRM Chapter 4. Also see https://www.esp32.com/viewtopic.php?t=3569

@AshUK thanks for the quick responses.
We already read them, but for the ESP32-WROVER-E we have the doubt if the recommended UART1 and UART2 pins are available.
I will try to explain what we found:
On ESP32 Datasheet table 1:

So it seems we must use for UART 2 (pins 25,26,32,33) and for UART 1 (pins 28,29,30,31)
But then on ESP32-WROVER-E Datasheet (page 20) is like these pins (25..33) are not available in the module (and used by flash and PSRAM)
Thanks

If the pin you wish to use is not exposed by the module you can use IO multiplexing to assign it to any pin. This is explain in the ESP-32 TRM Chapter 4. Also see https://www.esp32.com/viewtopic.php?t=3569

Ok, I will take a look and see if it solves our problem. Thanks

From ESP32 Datasheet

ESP32 has three UART interfaces, i.e., UART0, UART1 and UART2, which provide asynchronouscommunication (RS232 and RS485) and IrDA support, communicating at a speed of up to 5 Mbps. UARTprovides hardware management of the CTS and RTS signals and software flow control (XON and XOFF). All ofthe interfaces can be accessed by the DMA controller or directly by the CPU

And from https://www.esp32.com/viewtopic.php?t=3569:

The issue is that there are two ways of mapping pins: the GPIO mux and the IO_MUX. The GPIO mux allows you to map a peripheral to any pin, but it has the disadvantage that it introduces an APB clock (80MHz) tick delay in the signal; for some purposes this can be disadvantageous. Because of this, we also have the IO_MUX, which can map the signals of some peripherals to a very limited amount of IO pins; this reduces flexibility but because the IO_MUX does not have the delay, it can be useful for some purposes.

So I understand that ideally it is better to work with the mapping done by IO_MUX, that means using pins (25..33). But as in ESP32-WROVER-E these pins are used for other "internal" proposes (flash, PSRAM) it is needed to map other pins to the UARTS, using GPIO mux. This second way (GPIO mux) must work but we could experience some unexpected behaviour (maybe) introduced bytthat APB clock.

If it helps we use a WROVER-E module and make use of all three UARTs and we use the following the pins:
UART0 is unchanged as exposed by the module.
UART1_TX GPIO_NUM_27
UART1_RX GPIO_NUM_14
UART2_TX GPIO_NUM_2
UART2_RX GPIO_NUM_15

Thanks! We are gonna try these ones for our prototype

Hello @Andres-San ,
Yes. It has worked for me. My project is currently using following UART setup:

Which pins are you trying to use?
Have in mind that some GPIO's (>= GPIO_NUM_34) can just be used as input (and so they will not work as a UART pin):

@carlessole Thanks! Im on the Schematic yet, but those same doubts assaulted me every night haha.
After reading and reading, i have come to the conclusion that the person who wrote "Any GPIO" in the ESP32 DataSheet is wrong (or atleast missleading), because the IO_MUX shows otherwise.
For instance GPIO 15 cant be used as I2C on any of its functions (red), but MTD0, GPIO0, GPIO2 and GPIO4 can (blue).

Is this the same conclusion you've come to?
Best from Chile!

@Andres-San gpio mux has limited options but gpio matrix can connect almost any pin to almost any function.  Research gpio matrix.

Hi @Andres-San,
As said here: https://www.esp32.com/viewtopic.php?t=3569
"Any GPIO" is true always that you hardware (or module) is not using it for some other reasons. So, if you have the ESP- WROVER module you won't have all the GPIO available because some of them will be routed internally to SPI RAM and other peripherals.
But all the GPIOs accessible from outside de ESP-WROVER can be used as a GPIO if not other use is desired (as JTAG or whatever). Take a look here (https://www.espressif.com/sites/default/files/documentation/esp32-wrover-e_esp32-wrover-ie_datasheet_en.pdf#page=20):

@negativekelvin and @carlessole
Thank you so much for your clarification!, effectively now im missing some direct IO_MUX pins, because i have to use x3 UART, but only one is "wired" directly via IO_MUX (red) into Wrover-E, and for the rest i'll have to use GPIO_Matrix right?

Is this correct? if it is, now i'll have to look further on how to use GPIO matrix on code.
Best!

Hi @Andres-San ,
I don't know If I have inderstood you ok, but if your intention is to use GPIO9/10 (UART1) and GPIO16/17(UART2) that is not possible because those GPIOs are not available outside the WROOVER-E module.
You need to choose any GPIO available and free. And to use them is it as easy as (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/uart.html#_CPPv412uart_set_pin11uart_port_tiiii):

Instead of GPIO4/0 you can choose the one that you prefer (if it is available on WROOVER-E):

For example:
GPIO 23, GPIO22, GPIO19, GPIO18.....
/!\ GPIO number and PIN number is not the same. You need to use GPIO number.

Hi @carlessole,
Yes thank you for your patience!  I fully understand now =)
Best from Chile

@markusb237 If you want to use GPIO35, please pass 35 as the 3rd argument to this function:
#include <Arduino.h>

void setup() {
  Serial2.begin(115200,SERIAL_8N1,35,12);   // will use GPIO35 as RXD and GPIO12 as TXD
}

(All APIs in Arduino and ESP-IDF use GPIO numbers; In software, we never use the numbers of pins/pads of the chip/module.)

Doh! - Of course, how could I miss this...
Should explain why 7 leads to errors.
Thanks!
Regards


font size isn't set

Please correct me if I'm wrong, but my understanding is that this library should shrink text to fit within the width of an element. If I'm mistaken, feel free to close this issue.
issue:
This "lorem ipsum" text should be contained within the dark area.

The text element itself is the width of the dark area (~280px).
code:
// config
angular.module('app')
  .config(function(fitTextConfigProvider) {
    fitTextConfigProvider.config = {
      debounce: _.debounce
    };
  })

<!-- view -->
<h1 data-fittext ng-model='user.name' ng-bind='user.name'></h1>

CSS (from web inspector):

The following styles are set by this module:
{
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
}

Notice that "font-size" property is absent. The rest of the styles were defined in the CSS of my app.
EDIT: I should also note that no errors have been thrown.

@lynndylanhurley probably, the problem is in width: 100%. Try to set it in auto.

New version (3.2.0) is out, let me know if you are still having issues. If so, see if you can work off of the demo to narrow down the issue further...

still not fixed I got same problem. Text go out from div.
If one line word is long. For example: aaaaaaaaaaaaaaaaaaa|outside


Please mark RC as pre-release

Hi,
Please consider tagging RCs and other similar releases as pre-releases on github. In my case I'm using nvchecker with use_latest_release = True to keep track of new stable releases of packages I maintain, and I was notified by the 0.2.0rc1 release.
Thanks

Done. Try nvchecker again. I would do myself but can't see how to run command-line without creating a config file, shouldn't be this complex.

Yes, perfect, thanks!


Edge case, TCP dropping next expected segment when Assembler is full (?)

Reading
https://github.com/smoltcp-rs/smoltcp/blob/43567b9743cb9f422de83fad9ff42a6d13f6e5ee/src/socket/tcp.rs#L1532-L1547
It appears possible to error when the payload_offest is 0. I think we should reserve a single position in the contig to ensure we can always accept a segment with offset 0. Another option would be to eject the segment with the highest offset however I think could have other ramifications (possibly in sACK logic).
Is it okay to drop packets with offset 0? From my limited experience with TCP I would think that could possibly lock up the protocol. Note, I haven't written a test to confirm this edge case does actually occur. I may be available to investigate further after working on sACK support.

Oh yes, dropping a segment at offset=0 can definitely cause things to get stuck. Thanks for reporting!


Added redirect for Minikube

The Minikube page has moved to workstation subdirectory.
Add redirect to avoid 404.
/assign @sarahmaddox

Thanks!
/approve

Thanks @terrytangyuan , @sarahmaddox !


Diagnostics should notify when path params are not defined for a resource function

Description:
If path params are not added as parameters of a resource function, diagnostics should complain about it

outdated issue


Fixes #954. Example Pipfile.lock workflow.

Hope this helps. This is what I needed to know...

Thanks for this first time contribution to pipenv @rwillmer!  I requested a couple changes, but I think we can merge.

I can't see the changes suggested; where should I look?

https://github.com/kennethreitz/pipenv/pull/959/files/3e1816d70165e5e119440c5ed3ca28511628a48f  Should be listed above in this conversation.

That's what I thought but I'm just seeing my changes (I think). What did you want to alter?
Sent from my iPhone

On 24 Oct 2017, at 15:55, erinxocon<EMAIL_ADDRESS>wrote:
https://github.com/kennethreitz/pipenv/pull/959/files/3e1816d70165e5e119440c5ed3ca28511628a48f Should be listed above in this conversation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@erinxocon, it doesn't look like you left any feedback.

You know what helps?  If I hit the start review button.  My apologies!

What's the right protocol for adding that extra line to make into a heading? a separate pull request? or how do I add another commit to this same PR?

Just make sure you have the branch you submitted the PR on checked out and then add the commits there.

cool! thanks

Just note to myself:

it would be nice that feedback from maintainer will be in some constructive way rather than commit "who wrote this shit". It's disrespectful to @rwillmer who contributed that. There is no need for swearing especially that someone is contributing to project and if he doesn't know reStructuredText, it's ok to just point to some learning materials, rather demeaning someone work.
I wouldn't like to be treated like that @kennethreitz . Other contributors here are doing great job on talking with community without any swearing on someone input (thanks @nateprewitt @erinxocon @techalchemy for being really helpful, appreciate Your time to understand my issue and Your patience. )


order in which the items (photos) are retrieved

Again thanks for this incredible plugin! Keep it up! :)
As we can see on line Android, L279 and iOS, L49 is the order in which the items are return ascending. It feels a bit off, if I for instance open Instagram, Imgur, Whatsapp, etc.. I always see the pictures I took most recently first. I don't know if it is intentionally but I can imagine it is more convinient to chance the order. So the user "scrolls back in time"
Of course it is easy to reverse a javascript array, but then we have to "wait" till a function completes to reverse it. What are your thought on this?

I forgot to add a possible solution; for Android (+ " DESC") needs to be added;
// ../plugins/cordova-plugin-photo-library/src/android/PhotoLibraryService.java
final String sortOrder = MediaStore.Images.Media.DATE_TAKEN + " DESC";

and for iOS (true becomes false)
// ../plugins/cordova-plugin-photo-library/src/ios/PhotoLibraryService.swift
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]

I just wanted to post the exact same thing!
I definitely support this change. In my opinion the default should be descending (newest pictures first), ideally you could make it configurable by passing a parameter.
As it is now, the "chunked" feature is useless for anyone who whats to sort their pictures by date (desc) because you have to preload everything and then sort it in js. With this change I (and probably many others) could take advantage of the chunked callbacks.

Thank you for the change, published new version


Invalid query: error keep shown while listing the nodes

Description
This error occurred to me multiple times while listing or validating the node in different solutions.
Logs/Alerts

I've made multiple attempts to reproduce this issue on the Mainnet, but it appears to be working without any problems. I even recorded the process, and you can take a look at it:
Screencast from 09-14-2023 02:31:41 PM.webm
Additionally, I used the same query you provided to request the grid proxy with the exact query, and I received a successful response with no errors.
If you're still experiencing the same issue, could you please provide me with detailed steps to reproduce it on your end?
Thank you.

https://github.com/threefoldtech/tfgrid-sdk-ts/issues/1101
Both of this issues are related to the network being slow or connection error, same happens when trying to connect to the gridproxy or graphql and it fails.
You can see the network error in the console but playgorund doesn't display it and you can processed with deployment which cause more error after.
But this error are happening a lot on the mainnet cause it have a lot of farms and node, and I think playground need some kind of a network error handling to avoid this error.

Update:
I have a solution that I can do, to change/improve the error message.

Update:
The error message should be improved here https://github.com/threefoldtech/tfgrid-sdk-ts/pull/1111

Verified, Mainnet 2.1.1.
Error message was improved.


Typo fix in patroni/README.md: fo->of

Some typo fixes in the table.

/assign @timstoop

/ok-to-test


Equivalency: Equals/hashCode and null values

I have:
message MSG {
int32 a = 1
}

when using equals / hashCode with MSG i would expect the following to be true:
assert(MSG(a:0) == MSG());
assert(MSG(a:0).hashCode == MSG().hashCode);

The protobuf message differencer provides two comparison modes, Equivalent and Equals.
For Dart, however, I am not sure what to do to switch the generated Dart code to use the Equivalent mode for equals and hashCode.
I stumbled upon this issue when I had a protobuf message doing a round trip via a C++ server.
The dart code sent MSG(a:0) and the C++ Server responded with a message where the field a is not present, since the C++ protobuf code doesn't send 0 int values.
Since my Dart code heavily depends on equals and hashCode and I have several message types with several fields that could be zero which can originate from both Dart code and C++ code,  I would like to solve the issue somehow in the generated code (either on C++ or Dart side).

Related (maybe a duplicate): #691


Attempt to fix daemonsauce for node 0.12+

This updates daemonsauceNative.cc to use APIs from Node 0.12+

hmmm...so this will actually break compatibility with node 0.10? I think the recommended way to do this now is to use the NAN macros? https://www.npmjs.com/package/nan

You're right. Will fix it now.

@nicks Any idea on how to test this? I can successfully call acquireLock, but reopenStdout, for instance, is giving me a segmentation fault. :disappointed:

Ya this package is a PITA to test. I'll see what I can do tomorrow.
On May 12, 2015 5:27 PM, "Victor Gama"<EMAIL_ADDRESS>wrote:

@nicks https://github.com/nicks Any idea on how to test this? I can
successfully call acquireLock, but reopenStdout, for instance, is giving
me a segmentation fault. [image: :disappointed:]
—
Reply to this email directly or view it on GitHub
https://github.com/Medium/daemonsauce/pull/7#issuecomment-101426879.

ok, i think i got a handle on this. can you fill out a quick CLA for us?
https://github.com/Medium/opensource/blob/master/sign-cla.md
thanks again!

i also added some unit tests, so if you rebase travis should run them automatically.

CLA signed and email sent. (:
Will rebase in a minute.

sorry, this fell off my radar. i'm going to see if i can rebase myself and merge.

this was merged as https://github.com/Medium/daemonsauce/pull/10


Distribution parameters for Log-Normal are calculated wrong in LogNormal2 function

Has been fixed with #3.3.1


Remove ambiguous date(_:optional:unique:default:)

Environment
Vapor       : 2.0.0-beta.1
MySQLDriver : 2.0.0-beta.1
Swift       : 3.1
Xcode       : 8.3

Report
I got this compiler error:
Ambiguous use of 'date(_:optional:unique:default:)'
Found this candidate (Fluent.Builder)
Found this candidate (MySQLDriver.Builder)

when trying to compile this line:
builder.date("completed_on", optional: true)

Fixed! https://github.com/vapor/mysql-driver/releases/tag/2.0.0-beta.2

Would this also be an issue for other field types? At a quick glanceint seemed like it existed in both places as well

It's integer in this package so shouldn't be an issue


good teacher

Please don't test on public repos!  Not helpful to anyone 😟


Use actions/cache in the GitHub Actions

What do you want to improve?
Reduce the GitHub action execution time
What is the current behavior?
We are not using caching
What is the new behavior?
Use caching to improve execution time on most of the steps in the different GitHub Actions with actions/cache save and restore
:warning: Is this a breaking change?
Put an x in the boxes that apply

[ ] Yes
[x] No
[ ] Don't know

Reopening. The cache is enable in the CI.yaml and reduced the time by 2 minutes.
But it's not enabled on Docker yet. https://docs.docker.com/build/cache/backends/gha/


New theme Gruvbox-Green added

Hi wave I built this minimal theme for Spotify with Gruvbox palette.
It would be awesome if it could be added to this repo!

This looks similar to existing colour schemes. Please create a PR for adding a colours scheme instead.


Avoid type mismatch assignment of number to string in HotModuleReplacementPlugin

What kind of change does this PR introduce?

Refactor
Did you add tests for your changes?
No

If relevant, link to documentation update:
N/A

Summary
As part of #6862 I'm refactoring this for..in statement to be easier for TypeScript to understand.

Does this PR introduce a breaking change?
No

Other information
No reassigning numbers to strings is good for VMs expectations as well.

Thanks


What is the ID parameter in the Message interface?

I have started using the nestjs-sqs library and I didn't understand what should I pass as the id parameter (https://github.com/ssut/nestjs-sqs/blob/8074714bdc6567716d7fea7a8380e9d21a120971/lib/sqs.types.ts#L37) in the Message interface.
Should it be a unique value every time I send a task to the queue? If yes, could I use uuid to define it?

I am interested in this too. If I understand this correctly the sqs endpoint should return an id. Why do I need to create it myself beforehand?

Read this https://github.com/bbc/sqs-producer?tab=readme-ov-file#usage

@ruscon in config above it says that it should use body (I imagine some hash) as id if none is passed in, why is this required in nestjs-sqs?


ttnn.softmax returns zero valued tensor in convnet mnist model

Describe the bug
ttnn.softmax returns zero valued tensor in convnet mnist model resulting in PCC = 0.0.
To Reproduce
Pick the test from commit
Run pytest
Expected behavior
As the above shared configuration works in pytorch, it is expected to run in ttnn as well.
Screenshots
 ERROR    | models.utility_functions:comp_pcc:602 - One tensor is all zero
E       AssertionError: 0.0

CC: @boris-drazic @jvasilje

@vigneshkeerthivasanx , Can you check if the issue is still persistent?

@vigneshkeerthivasanx , Can you check if the issue is still persistent?

I checked yesterday, and the issue persists in the model.

@yugaoTT , Could you share any update on this issue, as it is a blocker for ConvNetMnist model?
cc: @boris-drazic

can you please try ttnn_tensor = ttnn.softmax(ttnn_tensor, dim=-1, numeric_stable=True) ?
we added a numeric_stable flag to make the computation more stable. Thanks

The issue was resolved by using numeric_stable=True in ttnn.softmax. Thank you.
Hence closing the ticket.


Detox Config File

I would like to suggest Detox to support its own "detox configuration file".
Although using package.json is great for starting up, after a while the configuration starts getting bigger and bigger and I think it makes sense to have its own configuration file.
I'm open to help to work in this feature, just want permission (and references) before starting doing so.

@LeoNatan Does that mean I have a green light?

@sidferreira I think you should work closely work with @noomorph on this. He had ideas on this previously and perhaps even had a POC.

@noomorph please LMK :)

Thanks @sidferreira! This has in fact already been discussed in #1910. Hopefully, it will be addressed real soon.


After authentication with Auth0, unknown method

I authenticate myself with Auth0, then
when executing the API method [GET /cars] via swagger, we get a 500, Internal server error
with the following logs on the server:
[Nest] 72323   - 2018-6-14 10:26:25   [ExceptionsHandler] this.authService.getUserId is not a function
TypeError: this.authService.getUserId is not a function
    at /Users/andries/projects/sandbox/awv-poc/chain-service/src/common/middleware/hlfcredsgenerator.middleware.ts:32:43

This was an issue migrating from nestjs 4 to 5. Fixed now!


Bug: can't use @stream-io/video-react-sdk in island

Hello,
I'm facing an issue regarding integration for @stream-io/video-react-sdk within an Island component I try to build. It seems that the react components aren't compatible out-of-the-box (I guess it's normal when using preact) but I don't know how to integrate them properly.
Can someone help me?
Ive alreay adjusted the "Imports" like that:
"imports": {     "$fresh/"<EMAIL_ADDRESS>    "preact"<EMAIL_ADDRESS>    "preact/"<EMAIL_ADDRESS>    "@preact/signals": "https://esm.sh/*<EMAIL_ADDRESS>    "@preact/signals-core": "https://esm.sh/*<EMAIL_ADDRESS>    "tailwindcss"<EMAIL_ADDRESS>    "tailwindcss/"<EMAIL_ADDRESS>    "tailwindcss/plugin"<EMAIL_ADDRESS>    "$std/"<EMAIL_ADDRESS>    "react": "https://esm.sh/preact/compat",     "react-dom": "https://esm.sh/preact/compat",     "react/jsx-runtime": "https://esm.sh/preact/compat",     "@stream-io/video-react-sdk": "https://esm.sh/@stream-io/video-react-sdk?external=react,react-dom,react%2Fjsx-runtime"   }
Without any success. I don't know what I'm missing or doing wrong. After serving the fresh app the following error appears in the Logs:
Uncaught (in promise) SyntaxError: The requested module 'react/jsx-runtime' does not provide an export named 'jsx' at https://esm.sh/v135/@stream-io/video-react-bindings@1.0.0/X-ZS9yZWFjdCxyZWFjdC1kb20scmVhY3QvanN4LXJ1bnRpbWU/denonext/video-react-bindings.mjs:2:8

the react components aren't compatible out-of-the-box

Yes, it is. The main idea is to use aliases when esm.sh does the build, and mark preact  as external so that its version is determined when esbuild in fresh compiles islands
a similar situation was discussed here: #606
So, the correct import option will be as follows:
https://esm.sh/@stream-io/video-react-sdk?target=esnext&alias=react:preact/compat,react-dom:preact/compat,@types/react:preact/compat&external=preact&bundle-deps
a couple of comments

if don't use target=esnext, browser will try to reach node:process which will end in error
in case with video-react-sdk bundling to one file required via bundle-deps otherwise esm gives module not found error

tiny exampe using fresh 2 and official example from stream docs
https://github.com/sanekb/stream-react-to-preact

Thank you so much @sanekb ! Give it a try right away! I think I understand the problem, but would like to dig deeper into this whole esm alias dependencies topic. Do you have further more resources for me to help me educate?
Best regards

Do you have further more resources

Unfortunately I don't have anything like that. I'm not sure they can even exist. I've only been using headlessui with fresh for a week and all my knowledge is limited to using esbuild's aliases while require esm.sh :(


cant login twitter with google

the login window didn jump out

Thank you for your feedback. I'll check it out.

I have a look. Here, Twitter uses the mode of opening a new window. Sorry, it doesn't support it. You can log in with your user name.


Update stable version in repo from 2.8.0 to 3.0.3

Think about update stable version to 3.0.3
Version: stable=2.8.0 (49 days old) => latest=3.0.3 (15 days old)
Installs: stable=717 (52.72%), latest=114 (8.38%), total=1360
Click to use developer portal
Click to edit
Note: This is an automatically generated message and not personally authored by bluefox!
Do not close this issue manually as a new issue will be created if condition for update still exists
@mcm1957 for evidence

This issue seems to be outdated.
This issue suggests to update the stable version of this adapter to 3.0.3 but the current stable version is already 3.0.3.
So this issue should be closed.
@mcm1957 for evidence


Performance regression between 4.4.0 and 4.3.5

Environment
Liquibase Version: 4.4.0
Liquibase Integration & Version: Quarkus
Liquibase Extension(s) & Version:
Database Vendor & Version: H2
Operating System Type & Version: Fedora
Description
I have noticed a large performance degradation between 4.4.0 and 4.3.5. When running the test for https://github.com/jhipster/jhipster-sample-app-quarkus using version 4.4.0 instead of 4.3.5 adds around 90s to the total testsuite runtime.
This appears to be due to liquibase.configuration.pro.EnvironmentValueProvider it seems to be used a lot to look for:
[liquibase.filterLogMessages]
[liquibase.pro.licenseKey]
[liquibase.hub.apiKey]
these same values are looked up repeatedly, and the iteration over all the env vars and then calling StringUtil.toKabobCase ends up being really expensive.
Steps To Reproduce
Build build and test https://github.com/jhipster/jhipster-sample-app-quarkus, note the total build time, change to version 4.4.0 and build, locally I see an extra 2m total time.
Actual Behavior
It is much slower than it used to be.
Expected/Desired Behavior
Performance will be comparable to 4.3.5

Thanks for the report. I'll take a look

I improved the performance to toKabobCase and also added some higher-up caching which significantly improved the performance in #1952

Awesome, thanks


Converting my entities ids to uuids

How can I convert some entities ids to uuids in Symfony 3.4
I have a legacy code of an application that me cannot re-make for now, and for some purpose I need to convert some integer ids to uuids.
Is there a best way to do it ?
I think we will use your librairie to generate new uuids but for now I couldn't find a best way that disabling database security and run a script to update all ids that I need.
Do you have any idea how we can make it safer and quicker to develop ?

@ramsey  talked about this https://github.com/ramsey/uuid/issues/251#issuecomment-437397692

I haven't really seen other users discuss how they actually did this, but as I was in the same situation where I had auto-incremented primary keys, but also wanted to use UUIDs, I will try to give some information on how I approached this. At the time the README denoted that a good practice was to use the "binary ordered time" uuid (UUID v1) with binary(16) for the primary key.
Having my mind set in migrating my entire database (back then +/- 45 tables) from auto-incremented integers to UUID v1, my workflow was as follows:

Create a migration to create temporary tables of the original tables, but with the temporary tables having primary key of type binary(16) and comment COMMENT '(DC2Type:uuid_binary_ordered_time)'.
Create a command (e.g. Symfony command) to iterate over your original tables data and re-insert each row in the temporary table, but now with the primary key set to (Uuid::uuid1())->getBytes() and bound as parameter type binary, ParameterType::BINARY. The more relations you have for your entities, the more iterations you'd likely need 🙃
After all data is inserted in the temporary tables, drop the original tables (DROP TABLE) and rename the temporary tables to the original table names (RENAME TO).

So it's definately doable as long as you don't rush it 🙂

Now almost 2 years later after I've migrated to UUID v1, I've reached a point I wanted to try and migrate to UUID v7. As you can imagine I was somewhat fearing that I needed to create another big migration to achieve this. but so my surprise I didn't have to!
I was swapping out the UuidOrderedTimeGenerator for the UuidV7Generator and the types from uuid_binary_ordered_time to uuid_binary. Then created a migration with doctrine (which updates the COMMENT types), ran it, and done.
The only catch was that I still had queries that were using BIN_TO_UUID(pk,1) (flag 1 denotes time parts swapped^1). The fix for this was simple, remove the 1. I found this quite interesting as this means BIN_TO_UUID(pk) from UUID v1 is the same as the UUID v7.
I'll end it with a final tip: if you use the binary UUID as a primary key, do not use is for things other than the database itself. Back then I thought it would be a good  idea to use the string implementation of the primary key as a reference to profile picture for users (files are stored externally), but I now realize I I'd have to rename those files as it previously retrieved the image based on BIN_TO_UUID(user.id,1) 🤦 A minor setback, but I know I should've done what I was already doing with other assets, and that is to just add an additional property to store a UUID v4 (with column type uuid) as a file reference.
Not sure if any of this helps but that's my experience with migrating/using UUIDs with doctrine.


Can't rectify wide-angle rgb image with mesh data generated by calibration tool.

I'm currently working a project which requires designing a custom wide-angle stereo camera using 2 RGB camera sensors and 1 FFC board.
With this setup, I followed the instructions https://docs.luxonis.com/en/latest/pages/calibration/ and calibrated the stereo pair at 800P successfully.
I also modified the mesh data file (left.calib, right.calib) generated by the calibration tool  since the camera roslution I'm using at runtime is 400P. The modified mesh data size is 1066 * 2 = (400 / 16  + 1) * (640 / 16 + 1) * 2.
With these 2 modified mesh files, I can generate dpeth data correctly with the snippet below:
static std::shared_ptr<dai::node::StereoDepth> createStereoDepthNode(
    dai::Pipeline pipeline) {
  auto depth = pipeline.create<dai::node::StereoDepth>();
  depth->setInputResolution(400, 640);
  depth->loadMeshFiles("left_mesh.calib", "right_mesh.calib");
  return depth;
}

And this proves the mesh data works with StereoDepth node.
Since my left and right cameras are actually RGB camera, I expect I should be able to rectify the color images as well using the same mesh data file with ImageManip node.
ImageManip node does provide an API setWarpMesh(mesh_data, mesh_width, mesh_height). However, the result I got was completely wrong with really bad artifacts.
The following are my implementation snippet for RGB image rectification and result I got:
static std::shared_ptr<dai::node::ImageManip> createRgbRectificationNode(
    dai::Pipeline pipeline, dai::CameraBoardSocket socket, int image_width,
    int image_height) {
  auto rectifyRgb = pipeline.create<dai::node::ImageManip>();

  std::string mesh_file;
  if (socket == dai::CameraBoardSocket::LEFT) {
    mesh_file = "left_mesh.calib";
  } else if (socket == dai::CameraBoardSocket::RIGHT) {
    mesh_file = "right_mesh.calib";
  }

  std::vector<std::pair<float, float>> mesh_data;
  std::ifstream fin(mesh_file, std::ios::binary);
  std::pair<float, float> mesh_point;

  while (fin.read(reinterpret_cast<char*>(&mesh_point),
                  sizeof(std::pair<float, float>))) {
    // calibration tool wrote mesh data in reseved order (y, x) already, however
    // setWarpMesh expected the data in the normal order (x, y).
      mesh_data.push_back(std::make_pair(mesh_point.second, mesh_point.first));
  }

  uint step_size = 16;
  rectifyRgb->initialConfig.setFrameType(dai::RawImgFrame::Type::YUV420p);
  rectifyRgb->setMaxOutputFrameSize(image_height * image_width * 3);
  // 400 / 16 + 1  = 26, 640 / 16 + 1 = 41, 26 * 41 = 1066
  rectifyRgb->setWarpMesh(mesh_data, image_width / step_size + 1,
                          image_height / step_size + 1);

  return rectifyRgb;
}

Left: rectified RGB image with artifacts.
Right: rectified image from stereo.rectifiedLeft/Right port.
Could anyone help me explain why the image artifacts get generated and what's the solution to fix this issue? Thanks!

Hi @developer-mayuan ,
Have you seen this example? Would it be helpful in your case?
Thanks, Erik

To second this, i also experienced the same banding issue, vertically. It is really strange, only happens for color camera input. If i convert it to mono using ImageManip first, it works fine.
Another workaround is to increase step_size, say from 16 to 20 or 40. @developer-mayuan could you try if increasing it would help for now?

To second this, i also experienced the same banding issue, vertically. It is really strange, only happens for color camera input. If i convert it to mono using ImageManip first, it works fine.
Another workaround is to increase step_size, say from 16 to 20 or 40. @developer-mayuan could you try if increasing it would help for now?

Thanks for following up this thread! Yes, I also found the workaround that creating a down-sampled mesh with step_size to 40 works. I think there is some hardware limitation in ImageManip node that it can't handle certain level of dense mesh data file.

@developer-mayuan  Good to hear that trick worked!
@Erol444  Could you help feedback this problem to the Luxonis team, on this particular mesh step size and band artifacts?

@szabi-luxonis could you check this out?

This issue was encountered on camera_node branch.
We assume this is the limitation of the caching mechanism that caches the data upfront in CMX, such that warp can run faster.
Bumping the step size to 64 from 16 solved the issue. Applicable to ImageManip node.

@szabi-luxonis  Thanks for checking! Yes step size increase seems always the workaround. But this is not elegant in two ways:

There is no warning when exactly this issue will occur, at which step size. It seems to largely depends on the exact pipeline configuration and resolution etc.
Increasing the step size will decrease the resolution / precision of the mesh, from my understanding. This will make undistortion less precise at the edge where more warping is present

Does the same issue applicable to Warp Node?

@chengguizi
No, Warp node should not suffer from this limitation (but it does have other limitations)

@themarpe @szabi-luxonis  Ok! I will give Warp node a try then, and report back.
So anything can be done to rescue the ImageManip setWarpMesh? The limitation makes it quite fuzzy to use :x I never know what is the good number for step size.

@chengguizi its a tradeoff at the moment with some additional benefits & performance that this limitation brings.
We might look into it more down the road, though for now this will likely remain


Improve error handling when the functions directory does not exist

When the user has not specified any Functions directory, this plugin currently fails with:
No function directory was specified

or
Could not list Netlify Functions files
Functions folder does not exist: dist/functions

However, this is reported as a plugin error. It would be better to report it as a user error using utils.build.failBuild() by checking at the beginning whether constants.FUNCTIONS_SRC points to an existing directory (using for example path-exists).

closed with https://github.com/bencao/netlify-plugin-inline-functions-env/commit/b42791a070d97afe178447390f5cc4d44e22208e

Hi @bencao,
Thanks! :tada:
One note though: utils.functions.listAll() can throw for other reasons than the functions folder not existing:
https://github.com/bencao/netlify-plugin-inline-functions-env/blob/master/index.js#L35-L41
https://github.com/netlify/build/blob/master/packages/functions-utils/src/main.js#L60-L70
Notably, utils.functions.listAll() throws if a Function file is requiring a dependency which is missing from the site (which is a very common error). In that case, the current code would show Failed to inline function files because netlify function folder was not configured or pointed to a wrong folder, please check your configuration which would be confusing considering the functions folder would most likely exist.
Instead, explicitly checking whether constants.FUNCTIONS_SRC exists, while still allowing any error from listAll() to propagate would give the correct behavior:
if (constants.FUNCTIONS_SRC === undefined || !(await pathExists(constants.FUNCTIONS_SRC))) {
  return utils.build.failBuild('Failed to inline functions files because Netlify functions folder was not configured or pointed to a wrong folder, please check your configuration')
}

const netlifyFunctions = await utils.functions.listAll()

hi @ehmicky,
what if in the plugin we catch the exception and throw with whatever message returned by utils.functions.listAll()?
Checking explicitly for undefined functions src folder feels like a bit burden to a plugin? (assume the above logic has to be implemented again and again by different plugins)

Good point!
Actually, I'll even say plugins should not have to add any error handling since this utility is provided by Netlify.
Checking the code, it looks like those errors are actually already handled as user errors:
https://github.com/netlify/build/blob/master/packages/functions-utils/src/main.js#L60-L70
https://github.com/netlify/build/blob/8779420d714e1b916c8a2cedf1e2593016f466f6/packages/build/src/plugins/child/utils.js#L54
Based on this, I am wondering how I got the following behavior:

However, this is reported as a plugin error.

If you remove any error handling on this function, then try to build with a functions folder, could you please confirm whether this is reported as a user error or as a plugin error? Thanks!


fix_data.yaml import element

I'm not sure if it is common knowledge but I've been seeing commits in dart-lang/sdk and flutter/flutter about this fix_data.yaml format for adding fixes. Just took a closer look at making one for my own package / packages that I contribute to which are going through some breaking changes / deprecations.
This wouldn't be a frequent fix, but in some cases packages have non-standard imports: e.g. (package:riverpod/all.dart vs package:riverpod/riverpod.dart). Currently the riverpod package is deprecating the all.dart import in favor of exporting everything through riverpod.dart. However, I didn't find a way to have the element for the fix be an import. Would this be possible to support?

Thanks for your interest!
The feature you found is one that is still under development and not yet supported for general use. We hope that it will prove useful both to users and to package developers, and that we can make it more generally available at a future date. In the meantime, we can’t make any guarantees related to breaking changes, such as possible changes to the file format.
As for the technical issue, yes, it’s likely that we could support a “move library” change. We don’t currently have the resources to implement this feature, but we’re not opposed to doing so in the future if this becomes a publicly available feature.
And, of course, contributions are always welcome. If you’re interested in implementing such an enhancement, I’d be happy to work with you to design the support and answer any questions you have about how to implement it.


Wasm post

Blocked on: GoogleChrome/samples#569
Target Live Date:  TBD

[X] This has been reviewed and approved by @jakearchibald, @mathiasbynens, @adanilo and bradnelson@
[X] I have run gulp test locally and all tests pass
[ ] I have added the appropriate type-something label.
[X] I've staged the site and manually verified that my content displays correctly.

CC: @petele @jpmedley

Whoops!
There were 6 warnings that will prevent this PR from being merged. Please take a look, and either fix, or provide a justification for why they can't be fixed.
WARNINGS
src/content/en/updates/2018/03/emscripting-a-c-library.md#L128 - '

:tada: This has been pushed live to https://developers.google.com/web/


Switch service is Sensor?

I see that Switch service is extended by DeconzService.SensorsResource, is that correct?
Seems like a wrong mixup with Button service.
Thanks

Yes, that’s correct.
I think you’re confusing deCONZ resources, HomeKit services, Homebridge deCONZ service delegates.  And wired vs wireless switches.

OK, so, I'll be happy to get familiar with those.
I want to contribute to the development to adopt some features like switch setting per group light accessory for groups of non dimmable lights such as outlets or even the ubisys SxR which in my case being used for a water boiler etc.
I have also some private stuff I'm using for my needs, so it will be very helpful to understand the project structure and terminology.
Thanks a lot for the amazing work!!!


Update README for new nu

I believe the plugin registration has changed, so README will need to be updated.

Addressed by @platlas !