gerbera: 1.8.1 -> 1.8.2

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/gerbera/gerbera/releases.
meta.description for gerbera is: "UPnP Media Server for 2020"
meta.homepage for gerbera is: "https://docs.gerbera.io/"
meta.changelog for gerbera is: ""
Updates performed

Version update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact

Checks done (click to expand)

built on NixOS

The tests defined in passthru.tests, if any, passed

/nix/store/8nzszdd4hf20aw2g85m25g0fiy3v0hdk-gerbera-1.8.2/bin/gerbera passed the binary check.

1 of 1 passed binary check by having a zero exit code.

1 of 1 passed binary check by having the new version present in output.

found 1.8.2 with grep in /nix/store/8nzszdd4hf20aw2g85m25g0fiy3v0hdk-gerbera-1.8.2

found 1.8.2 in filename of file in /nix/store/8nzszdd4hf20aw2g85m25g0fiy3v0hdk-gerbera-1.8.2

directory tree listing: https://gist.github.com/be49b26f15e2fbb1f803799e3236641f

du listing: https://gist.github.com/a99e5feccb692b2d6d7c6550e3779ab5

Rebuild report (if merged into master) (click to expand)

45 total rebuild path(s)

15 package rebuild(s)

15 x86_64-linux rebuild(s)
11 i686-linux rebuild(s)
8 x86_64-darwin rebuild(s)
11 aarch64-linux rebuild(s)

First fifty rebuilds by attrpath
bmake
delve
diffoscope
gerbera
hikari
kea
kgt
libfsm
nixos-install-tools
python38Packages.r2pipe
python39Packages.r2pipe
radare2
tests.nixos-functions.nixos-test
vimPlugins.vim-go
zsh-completions

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/8nzszdd4hf20aw2g85m25g0fiy3v0hdk-gerbera-1.8.2 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A gerbera https://github.com/r-ryantm/nixpkgs/archive/eca4094cd22cf5763702602d10a6e20872307cb5.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/8nzszdd4hf20aw2g85m25g0fiy3v0hdk-gerbera-1.8.2
ls -la /nix/store/8nzszdd4hf20aw2g85m25g0fiy3v0hdk-gerbera-1.8.2/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package failed to build:

nixos-install-tools

1 package built:

gerbera

Maintainer pings
cc @ardumont for testing.

Result of nixpkgs-review pr 125192 at eca4094c run on aarch64-linux 1

2 packages built successfully:

gerbera
nixos-install-tools

Result of nixpkgs-review pr 125192 run on x86_64-linux 1

1 package blacklisted:

tests.nixos-functions.nixos-test

1 package failed to build:

nixos-install-tools

1 package built:

gerbera


Ransomware Policy

Sources:
https://github.com/awslabs/aws-security-assessment-solution

AWS Core security services enabled (GuardDuty, SecurityHub)
Checks for EBS volumes with no snapshot
Checks for S3 bucket replication JobStatus
Checks for EC2 instances that can not be managed with SSM
Checks for Stale IAM roles that have been granted S3 access but have not used them in the last 60 days
Checks for S3 deny public access enablement

Add this https://github.com/RhinoSecurityLabs/Cloud-Security-Research/blob/master/AWS/s3_ransomware/s3-ransomware-poc.py

Discussed with Jason to check the MFA Delete flags on the S3 buckets
Rule which check if MFA Delete is disabled (violation)

As discussed with Jason:

Check if there any assets in region there should be GuardDuty, SecurityHub enabled for that region

Security Best Practice for S3:
https://docs.amazonaws.cn/en_us/AmazonS3/latest/userguide/security-best-practices.html

GuardDuty configuration on Jason stack
AWS::GuardDuty::Detector | ap-northeast-1
AWS::GuardDuty::Detector | ap-northeast-2
AWS::GuardDuty::Detector | ap-south-1
AWS::GuardDuty::Detector | ap-southeast-1
AWS::GuardDuty::Detector | ap-southeast-2
AWS::GuardDuty::Detector | ca-central-1
AWS::GuardDuty::Detector | eu-central-1
AWS::GuardDuty::Detector | eu-north-1
AWS::GuardDuty::Detector | eu-west-1
AWS::GuardDuty::Detector | eu-west-2
AWS::GuardDuty::Detector | eu-west-3
AWS::GuardDuty::Detector | sa-east-1
AWS::GuardDuty::Detector | us-east-1-fips
AWS::GuardDuty::Detector | us-east-2-fips
AWS::GuardDuty::Detector | us-west-1-fips
AWS::GuardDuty::Detector | us-west-2-fips

If Im not mistaken the Replication status is an Object level attribute describing replication state for chosen object:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-status.html
Assuming that we would need to grab metadata of all object in all buckets for specified region.

As discussed with @kickroot  we will create another policy AWS-Ransomware-Policy  and link existing rules there

@kickroot  FYI
Checks for Stale IAM roles that have been granted S3 access but have not used them in the last 60 days
Queries are ready for this role processing but we have problem with AWS Java SDK v2.
IAMClient.listRolesPaginator doesn't return the roleLastUsed data for each role in request
On the other hand direct request to getRole(..) return that data.
The only solution for us will be to request role data directly by its name for each encountered roles from listRolesPaginator response.
Benchmarks: for 55 Roles on your account we are dropping down by additional 10 seconds to get data for each role
Below simple test verify this behaviour:
  @Test
  public void testS3Discovery() {
    System.getProperties().setProperty("aws.accessKeyId", "<replace me>");
    System.getProperties().setProperty("aws.secretAccessKey", "<remplace me>/");

    // when
    IamClient client = AWSUtils.configure(IamClient.builder(), BASE_REGION);
    client.listRolesPaginator().roles().forEach(listedRole -> {
      Role role = client.getRole(builder -> builder.roleName(listedRole.roleName()).build()).role();

      assertNull(listedRole.roleLastUsed()); // <-- listed has no last access data
      assertNotNull(role.roleLastUsed()); // <-- direct request return complete role data WITH lastUsed data

      System.out.println("Role name: " + role.arn() + " rolelastUsed: " + role.roleLastUsed());
    });
  }

Thanks Maksym.  Go ahead and make the getRole() call.

Checks for EBS volumes with no snapshot - done


Active tab color conflicts with timecop pane

Not sure if this is a theme issue or a timecop issue, but the active tab color doesn't match the background for the timecop pane. It looks strange compared to regular editors where the active tab color matches the background color.

This is atom 0.190.

:+1:  Will look like this:


Inconsistent ShouldBeUnique behavior for missing models

Laravel Version
10.42.0
PHP Version
8.3.2
Database Driver & Version
Redis 7.2.4
Description
Queued jobs with ShouldBeUnique may cause stale unique locks in the case when the dependent model is missing.
According to the source code of the CallQueuedHandler::call() unique lock cleanup may never be reached in case if the job depends on the missing model AND the job is configured to be deleted when the model is missing (public $deleteWhenMissingModels = true).
Steps To Reproduce
The PoC is made using Redis queue, a similar approach may work with other drivers.

Create a new project: laravel new poc.
Ensure Redis is configured & reachable in your .env file. WARNING: PoC will flush all keys.
Create poc.php file with the following contents:

<?php

use Illuminate\Bus\Queueable;
use Illuminate\Queue\WorkerOptions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Redis;
use Illuminate\Queue\SerializesModels;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Queue\ShouldBeUnique;

require 'vendor/autoload.php';
$app = require __DIR__.'/bootstrap/app.php';
$cli = $app->make(Kernel::class);
$cli->bootstrap();

config([
    'database.default' => 'sqlite',
    'queue.default' => 'redis',
    'cache.default' => 'redis',
]);

@unlink(config('database.connections.sqlite.database'));
$cli->call('migrate', ['--force' => true]);

DB::unprepared("
    CREATE TABLE IF NOT EXISTS main (
        id INTEGER NOT NULL PRIMARY KEY,
        name VARCHAR(255) UNIQUE
    )
");

DB::unprepared("
    CREATE TABLE IF NOT EXISTS secondary (
        id INTEGER NOT NULL PRIMARY KEY,
        name VARCHAR(255) NOT NULL
    )
");

// ensure there are no keys in the DB
Redis::flushdb();

class Main extends Model {
    public $table = 'main';
    public $timestamps = false;
    public $fillable = ['name'];
}

class Secondary extends Model {
    public $table = 'secondary';
    public $timestamps = false;
    public $fillable = ['name'];
}

class MyJob implements ShouldQueue, ShouldBeUnique {
    use Dispatchable, Queueable, SerializesModels;

    public $tries = 1;
    public $maxExceptions = 1;
    public $deleteWhenMissingModels = true;

    public function __construct(
        public Main $main,
        public Secondary $secondary,
    )
    {
    }

    public function handle() {
    }

    public function uniqueId() {
        return 'job-for-' . $this->main->id;
    }
}

// create 2 instances
$main = Main::create(['name' => 'main model']);
$secondary = Secondary::create(['name' => 'secondary model']);

// and schedule a job for them
MyJob::dispatch($main, $secondary);

// delete the secondary model
$secondary->delete();

// run the job
app('queue.worker')->runNextJob('redis', 'default', new WorkerOptions);

echo 'Queue size: ', Queue::size('default'), PHP_EOL; // no tasks left
echo 'Redis contents:', PHP_EOL;
dump(Redis::keys('*')); // unique id is still there

Execute the poc.php php poc.php
Inspect the output to see the stale unique lock

Output
Queue size: 0
Redis contents:
array:1 [
  0 => "laravel_database_laravel_cache_:laravel_unique_job:MyJobjob-for-1"
] // poc.php:95

Expected result
The unique lock has been removed.
Actual result
A stale unique lock still exists.

The right approach here is to not make uniqueId dependent on the model and assign the id to the job when constructing it. I don't think you can expect deleteWhenMissingModels to be compatible with a behaviour in your jobs where you at all times need access to the model.

The bug is not about the uniqueId as this can be addressed in the user code.
The bug is that deleteWhenModelMissing configuration may effectively break the unique job lock mechanism causing a particular kind of jobs to be blocked until manual intervention. And there are no log messages or errors logged.
Neither of the cases is mentioned in the documentation and it took a while to figure out what was happening on the server and why there are so many stale unique locks.

To make it more clear, here's another PoC to be executed in the same environment (step 3).
<?php

use Illuminate\Bus\Queueable;
use Illuminate\Queue\WorkerOptions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Redis;
use Illuminate\Queue\SerializesModels;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Queue\ShouldBeUnique;

require 'vendor/autoload.php';
$app = require __DIR__.'/bootstrap/app.php';
$cli = $app->make(Kernel::class);
$cli->bootstrap();

config([
    'database.default' => 'sqlite',
    'queue.default' => 'redis',
    'cache.default' => 'redis',
]);

@unlink(config('database.connections.sqlite.database'));
$cli->call('migrate', ['--force' => true]);

DB::unprepared("
    CREATE TABLE main (
        id INTEGER NOT NULL PRIMARY KEY,
        name VARCHAR(255) UNIQUE
    )
");

// ensure there are no keys in the DB
Redis::flushdb();

class Main extends Model {
    public $table = 'main';
    public $timestamps = false;
    public $fillable = ['name'];
}

class MyJob implements ShouldQueue, ShouldBeUnique {
    use Dispatchable, Queueable, SerializesModels;

    public $tries = 1;
    public $deleteWhenMissingModels = true;

    public function __construct(
        public Main $main,
    )
    {
    }

    public function handle() {
    }
}

// create the job instance
$instance = Main::create(['name' => 'main model']);

// and schedule a job for them
MyJob::dispatch($instance);

// delete the secondary model
$instance->delete();

// run the job
app('queue.worker')->runNextJob('redis', 'default', new WorkerOptions);

echo 'Queue size: ', Queue::size('default'), PHP_EOL; // no tasks left
echo 'Redis contents:', PHP_EOL;
dump(Redis::keys('*')); // unique id is still there

I would also argue, that unique ID is being created and maintained by the framework. Hence it is framework's job to ensure that the unique ID is properly attached to the job to avoid special cases like the described one.
But skip that for now, the fix for the lock itself would be highly appreciated.

Thanks @naquad for that explanation. I'll re-open this one. We'd appreciate a PR for a fix if anyone can figure one out.

Here's my take on the fix that needs some blessing before I get knee-deep into fixing tests.
A somewhat hackish way would be the following:

Make UniqueLock::getKey() public static (the naming scheme is a pure function, so it can be static IMHO).
Update UniqueLock::getKey(): if it receives a string that looks like a unique lock key (just a precaution to ensure everything explodes if misused), it will return it as is.
Update Queue::createObjectPayload() to save the unique ID as seen during the job queuing.
Update CallQueuedHandler to rely on the unique ID in the payload rather than trying to get it from the job.

The patch would look like this:
diff --git a/src/Illuminate/Bus/UniqueLock.php b/src/Illuminate/Bus/UniqueLock.php
index a4066b77c1..b6799ed504 100644
--- a/src/Illuminate/Bus/UniqueLock.php
+++ b/src/Illuminate/Bus/UniqueLock.php
@@ -3,6 +3,7 @@
 namespace Illuminate\Bus;

 use Illuminate\Contracts\Cache\Repository as Cache;
+use Illuminate\Support\Str;

 class UniqueLock
 {
@@ -40,7 +41,7 @@ public function acquire($job)
                     ? $job->uniqueVia()
                     : $this->cache;

-        return (bool) $cache->lock($this->getKey($job), $uniqueFor)->get();
+        return (bool) $cache->lock(static::getKey($job), $uniqueFor)->get();
     }

     /**
@@ -55,7 +56,7 @@ public function release($job)
                     ? $job->uniqueVia()
                     : $this->cache;

-        $cache->lock($this->getKey($job))->forceRelease();
+        $cache->lock(static::getKey($job))->forceRelease();
     }

     /**
@@ -64,8 +65,12 @@ public function release($job)
      * @param  mixed  $job
      * @return string
      */
-    protected function getKey($job)
+    protected static function getKey($job)
     {
+        if (is_string($job) && Str::startsWith($job, 'laravel_unique_job:')) {
+            return $job;
+        }
+
         $uniqueId = method_exists($job, 'uniqueId')
                     ? $job->uniqueId()
                     : ($job->uniqueId ?? '');
diff --git a/src/Illuminate/Queue/CallQueuedHandler.php b/src/Illuminate/Queue/CallQueuedHandler.php
index 5bee1d9ebb..20c639ef81 100644
--- a/src/Illuminate/Queue/CallQueuedHandler.php
+++ b/src/Illuminate/Queue/CallQueuedHandler.php
@@ -60,17 +60,18 @@ public function call(Job $job, array $data)
                 $job, $this->getCommand($data)
             );
         } catch (ModelNotFoundException $e) {
+            $this->ensureUniqueJobLockIsReleased($data['uniqueId']);
             return $this->handleModelNotFound($job, $e);
         }

         if ($command instanceof ShouldBeUniqueUntilProcessing) {
-            $this->ensureUniqueJobLockIsReleased($command);
+            $this->ensureUniqueJobLockIsReleased($data['uniqueId']);
         }

         $this->dispatchThroughMiddleware($job, $command);

         if (! $job->isReleased() && ! $command instanceof ShouldBeUniqueUntilProcessing) {
-            $this->ensureUniqueJobLockIsReleased($command);
+            $this->ensureUniqueJobLockIsReleased($data['uniqueId']);
         }

         if (! $job->hasFailed() && ! $job->isReleased()) {
@@ -199,10 +200,11 @@ protected function ensureSuccessfulBatchJobIsRecorded($command)
      * @param  mixed  $command
      * @return void
      */
-    protected function ensureUniqueJobLockIsReleased($command)
+    protected function ensureUniqueJobLockIsReleased($uniqueId)
     {
-        if ($command instanceof ShouldBeUnique) {
-            (new UniqueLock($this->container->make(Cache::class)))->release($command);
+        if ($uniqueId !== null) {
+            (new UniqueLock($this->container->make(Cache::class)))
+                ->release($uniqueId);
         }
     }

@@ -246,7 +248,7 @@ public function failed(array $data, $e, string $uuid)
         $command = $this->getCommand($data);

         if (! $command instanceof ShouldBeUniqueUntilProcessing) {
-            $this->ensureUniqueJobLockIsReleased($command);
+            $this->ensureUniqueJobLockIsReleased($data['uniqueId']);
         }

         if ($command instanceof \__PHP_Incomplete_Class) {
diff --git a/src/Illuminate/Queue/Queue.php b/src/Illuminate/Queue/Queue.php
index 09eb245263..902e369965 100755
--- a/src/Illuminate/Queue/Queue.php
+++ b/src/Illuminate/Queue/Queue.php
@@ -4,9 +4,12 @@

 use Closure;
 use DateTimeInterface;
+use Illuminate\Bus\UniqueLock;
 use Illuminate\Container\Container;
 use Illuminate\Contracts\Encryption\Encrypter;
 use Illuminate\Contracts\Queue\ShouldBeEncrypted;
+use Illuminate\Contracts\Queue\ShouldBeUnique;
+use Illuminate\Contracts\Queue\ShouldBeUniqueUntilProcessing;
 use Illuminate\Contracts\Queue\ShouldQueueAfterCommit;
 use Illuminate\Queue\Events\JobQueued;
 use Illuminate\Queue\Events\JobQueueing;
@@ -149,6 +152,7 @@ protected function createObjectPayload($job, $queue)
             'backoff' => $this->getJobBackoff($job),
             'timeout' => $job->timeout ?? null,
             'retryUntil' => $this->getJobExpiration($job),
+            'uniqueId' => $this->getJobUniqueId($job),
             'data' => [
                 'commandName' => $job,
                 'command' => $job,
@@ -167,6 +171,24 @@ protected function createObjectPayload($job, $queue)
         ]);
     }

+    /**
+     * Get the unique ID of the job
+     *
+     * @param object $job
+     * @return string|null
+     */
+    protected function getJobUniqueId($job)
+    {
+        if (
+            $job instanceof ShouldBeUnique ||
+            $job instanceof ShouldBeUniqueUntilProcessing
+        ) {
+            return UniqueLock::getKey($job);
+        }
+
+        return null;
+    }
+
     /**
      * Get the display name for the given job.
      *

Scratch that. uniqueVia breaks in this implementation.

Ok, I think I got it right. The idea is: to create a helper class to manage the lock based on the initial data. This way the UniqueLock doesn't need to be changed at all, although, some duplicate code is present, but I don't think it's a big issue. The only thing that worries me is the reliance on the cache store name.
diff --git a/src/Illuminate/Queue/CallQueuedHandler.php b/src/Illuminate/Queue/CallQueuedHandler.php
index 5bee1d9ebb..0cefafa95f 100644
--- a/src/Illuminate/Queue/CallQueuedHandler.php
+++ b/src/Illuminate/Queue/CallQueuedHandler.php
@@ -4,13 +4,10 @@

 use Exception;
 use Illuminate\Bus\Batchable;
-use Illuminate\Bus\UniqueLock;
 use Illuminate\Contracts\Bus\Dispatcher;
-use Illuminate\Contracts\Cache\Repository as Cache;
 use Illuminate\Contracts\Container\Container;
 use Illuminate\Contracts\Encryption\Encrypter;
 use Illuminate\Contracts\Queue\Job;
-use Illuminate\Contracts\Queue\ShouldBeUnique;
 use Illuminate\Contracts\Queue\ShouldBeUniqueUntilProcessing;
 use Illuminate\Database\Eloquent\ModelNotFoundException;
 use Illuminate\Pipeline\Pipeline;
@@ -60,17 +57,18 @@ public function call(Job $job, array $data)
                 $job, $this->getCommand($data)
             );
         } catch (ModelNotFoundException $e) {
+            $this->ensureUniqueJobLockIsReleased($data);
             return $this->handleModelNotFound($job, $e);
         }

         if ($command instanceof ShouldBeUniqueUntilProcessing) {
-            $this->ensureUniqueJobLockIsReleased($command);
+            $this->ensureUniqueJobLockIsReleased($data);
         }

         $this->dispatchThroughMiddleware($job, $command);

         if (! $job->isReleased() && ! $command instanceof ShouldBeUniqueUntilProcessing) {
-            $this->ensureUniqueJobLockIsReleased($command);
+            $this->ensureUniqueJobLockIsReleased($data);
         }

         if (! $job->hasFailed() && ! $job->isReleased()) {
@@ -196,13 +194,13 @@ protected function ensureSuccessfulBatchJobIsRecorded($command)
     /**
      * Ensure the lock for a unique job is released.
      *
-     * @param  mixed  $command
+     * @param  array  $data
      * @return void
      */
-    protected function ensureUniqueJobLockIsReleased($command)
+    protected function ensureUniqueJobLockIsReleased($data)
     {
-        if ($command instanceof ShouldBeUnique) {
-            (new UniqueLock($this->container->make(Cache::class)))->release($command);
+        if (isset($data['uniqueHandler'])) {
+            unserialize($data['uniqueHandler'])->unlock($this->container);
         }
     }

@@ -246,7 +244,7 @@ public function failed(array $data, $e, string $uuid)
         $command = $this->getCommand($data);

         if (! $command instanceof ShouldBeUniqueUntilProcessing) {
-            $this->ensureUniqueJobLockIsReleased($command);
+            $this->ensureUniqueJobLockIsReleased($data);
         }

         if ($command instanceof \__PHP_Incomplete_Class) {
diff --git a/src/Illuminate/Queue/Queue.php b/src/Illuminate/Queue/Queue.php
index 09eb245263..9e9f3e4afc 100755
--- a/src/Illuminate/Queue/Queue.php
+++ b/src/Illuminate/Queue/Queue.php
@@ -150,6 +150,7 @@ protected function createObjectPayload($job, $queue)
             'timeout' => $job->timeout ?? null,
             'retryUntil' => $this->getJobExpiration($job),
             'data' => [
+                'uniqueHandler' => UniqueHandler::forJob($job),
                 'commandName' => $job,
                 'command' => $job,
             ],
diff --git a/src/Illuminate/Queue/UniqueHandler.php b/src/Illuminate/Queue/UniqueHandler.php
new file mode 100644
index<PHONE_NUMBER>..fb906b965a
--- /dev/null
+++ b/src/Illuminate/Queue/UniqueHandler.php
@@ -0,0 +1,133 @@
+<?php
+
+namespace Illuminate\Queue;
+
+use Illuminate\Bus\UniqueLock;
+use Illuminate\Contracts\Container\Container;
+use Illuminate\Contracts\Queue\ShouldBeUnique;
+use Illuminate\Contracts\Cache\Repository as Cache;
+use Illuminate\Contracts\Cache\Factory as CacheFactory;
+use Illuminate\Contracts\Queue\ShouldBeUniqueUntilProcessing;
+
+/**
+ * A helper class to manage the unique ID and cache instance for a job
+ * base on the data of the job itself.
+ */
+class UniqueHandler
+{
+    /**
+     * The unique ID for the job.
+     *
+     * @var string|null
+     */
+    protected $uniqueId = null;
+
+    /**
+     * Cache connection name for the job.
+     *
+     * @var string|null
+     */
+    protected $uniqueVia = null;
+
+    /**
+     * The container instance.
+     * @var \Illuminate\Contracts\Container\Container
+     */
+    protected $container;
+
+    /**
+     * Create a new handler instance.
+     *
+     * @param object $job
+     */
+    public function __construct(object $job)
+    {
+        if (method_exists($job, 'uniqueId')) {
+            $this->uniqueId = $job->uniqueId();
+        }
+
+        if (method_exists($job, 'uniqueVia')) {
+            $this->uniqueVia = $job->uniqueVia();
+        }
+    }
+
+    /**
+     * Creates a new instance if the job should be unique.
+     *
+     * @param object $job
+     * @return UniqueHandler|null
+     */
+    public static function forJob(object $job)
+    {
+        if (
+            $job instanceof ShouldBeUnique ||
+            $job instanceof ShouldBeUniqueUntilProcessing
+        ) {
+            return new static($job);
+        }
+
+        return null;
+    }
+
+    /**
+     * Sets the container instance.
+     *
+     * @param \Illuminate\Contracts\Container $container
+     * @return void
+     */
+    public function setContainer(Container $container)
+    {
+        $this->container = $container;
+    }
+
+    /**
+     * Gets the container instance.
+     *
+     * @return \Illuminate\Contracts\Container
+     */
+    public function getContainer()
+    {
+        return $this->container;
+    }
+
+    /**
+     * Returns the unique ID for the job.
+     *
+     * @return string
+     */
+    public function uniqueId()
+    {
+        return $this->uniqueId ?? '';
+    }
+
+    /**
+     * Returns the cache instance for the job.
+     *
+     * @return \Illuminate\Contracts\Cache\Repository
+     */
+    public function uniqueVia()
+    {
+        if ($this->uniqueVia === null) {
+            return $this->container->make(Cache::class);
+        }
+
+        return $this->container->make(CacheFactory::class)->
+            store($this->uniqueVia);
+    }
+
+    /**
+     * Releases the lock for the job.
+     * Optionally takes a container instance to use.
+     *
+     * @param \Illuminate\Contracts\Container|null $container
+     * @return void
+     */
+    public function unlock(?Container $container = null)
+    {
+        if ($container !== null) {
+            $this->setContainer($container);
+        }
+
+        (new UniqueLock($this->container->make(Cache::class)))->release($this);
+    }
+}

I'm sorry @naquad but it seems that this is a no-fix for us right now. If you could produce a much simpler PR like Taylor requested, we'd love to review it. Thanks


Facebook OAuth using Firebase in React Native

Article checklist
NOTE: (Please ensure that you have only one open issue + linked pull request at a time. This will ensure that we complete the article in a timely manner from inception to publishing.)
Preliminary Checks - Formatting and Structure

[x] Does your article follow any of the suggested structure formats? - see example formats
[x] Is your article properly formatted in Markdown? - see Github Markdown guide
[x] Have you used the correct folder and file structure? - see Contribution Guidelines
[x] Is your article over 750 words? - Tool: Wordcounter.net
[x] Have you used our preferred heading structure? - H3 (###) and up
[x] Does your article provide enough value and detail about your topic? - Articles should be clear, accurate, and fully explained.
[x] Can your article be understood by beginners? - Assume the audience is smart but has no prior exposure to the common terminology in your article.
[x] Have you included a hero image that is 600x400 pixels and have the copyright to use it? - Tools: Pixlr Image Editor for resizing and Unsplash for Creative Commons images
[x] In your PR - add a comment that states "This fixes #(enter your Idea Content Form #)" to link and close your Idea Content (issue) when the PR is merged.

Grammar & plagiarism checks

[x] Have you spellchecked and grammar checked your article? - Tools: Write&Improve - ProWritingAid -  Grammarly
[ ] Please place your article through a 3rd party plagiarism checker? We suggest using Quetext, this tool is free and has a daily limit. We typically accept articles with 10% or less.
[x] Have you checked your article for readability? - Tool: Hemmingway
[x] Have you added sources for quotes and images that aren't yours?

Technical checks

[x] Are your code snippets properly formatted for syntax highlighting - see Syntax guide

Contribution guidelines
For first-time contributors and for more details, see Contributing Guidelines
This fixes #1891

[2120420-9a0785b4c5f532668055-1617896116929.pdf](https://github.com/secti@zolomohan n-engineering-education/engineering-education/files/6279775/2120420-9a0785b4c5f532668055-1617896116929.pdf)
Report % @zolomohan

@zolomohan Please take a look at the report

@hectorkambow @cyberShaw working on it.

plagiarism check done

@cyberShaw Forgot to ping you. Fixed those minor issues.

@cyberShaw Forgot to ping you. Fixed those minor issues.

No worries, @zolomohan. I'll do the tech review today

@cyberShaw updated the links.

great work @zolomohan
cc @cyberShaw

thanks @hectorkambow


Performance disparity in StandardUC between Model and Simulation

When we solve the StandardUnitCommitment model using just the Problem framework, we implement one formulation of the duration constraints that use the initial condition of the time spent in a particular state (on/off) to decide the number of variables to add to the model. This is incompatible with in-memory updates using ParameterJuMP (can only handle RHS), so we implement a different formulation that keeps track of the state on the RHS.  This has been discussed in the literature here and here
I noted that depending on the solver, this could have large performance consequences. Presumably, because the solvers perform different internal substitutions. The tradeoff here is the re-creating the UC problem for every solve vs. in-memory update. There is no straightforward rule of thumb since these outcomes are heavily dependent on the model's parameters, the number of units, and the solver heuristics.
Using the ExtremeSolarTexas case, we can see the following outcomes.
With CPLEX not using the parameters we get:
version identifier: <IP_ADDRESS> | 2020-11-10 | 9bedb6d68
CPXPARAM_Emphasis_MIP                            1
CPXPARAM_MIP_Tolerances_MIPGap                   0.01
Tried aggregator 3 times.
MIP Presolve eliminated 23868 rows and 12408 columns.
MIP Presolve added 108 rows and 0 columns.
MIP Presolve modified 6092 coefficients.
Aggregator did 1503 substitutions.
Reduced MIP has 103185 rows, 124689 columns, and 1100035 nonzeros.
Reduced MIP has 34301 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 1.39 sec. (924.73 ticks)
Probing fixed 1501 vars, tightened 400 bounds.
Probing changed sense of 242 constraints.
Probing time = 2.49 sec. (190.52 ticks)
Cover probing fixed 0 vars, tightened 63 bounds.
Tried aggregator 2 times.
Detecting symmetries...
MIP Presolve eliminated 3395 rows and 2959 columns.
MIP Presolve added 2 rows and 0 columns.
MIP Presolve modified 185 coefficients.
Aggregator did 2 substitutions.
Reduced MIP has 99790 rows, 121728 columns, and 1080671 nonzeros.
Reduced MIP has 32708 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 1.37 sec. (1071.98 ticks)
Probing time = 0.24 sec. (35.56 ticks)
Cover probing fixed 0 vars, tightened 63 bounds.
Clique table members: 565922.
Tightened 63 constraints.
MIP emphasis: integer feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 8 threads.
Root relaxation solution time = 33.34 sec. (10575.89 ticks)

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

      0     0   3.09365e+07  5141                 3.09365e+07       41
      0     0   3.21964e+07  2875                  Cuts: 8993    33612
*     0+    0                       3.25812e+07   3.21964e+07             1.18%
      0     0   3.23820e+07   777   3.25812e+07    Cuts: 8764    40919    0.61%

GUB cover cuts applied:  2
Clique cuts applied:  1255
Implied bound cuts applied:  9557
Flow cuts applied:  2154
Mixed integer rounding cuts applied:  2520
Zero-half cuts applied:  27
Lift and project cuts applied:  82
Gomory fractional cuts applied:  76

Root node processing (before b&c):
  Real time             =  193.43 sec. (66501.28 ticks)
Parallel b&c, 8 threads:
  Real time             =    0.00 sec. (0.00 ticks)
  Sync time (average)   =    0.00 sec.
  Wait time (average)   =    0.00 sec.
                          ------------
Total (root+branch&cut) =  193.43 sec. (66501.28 ticks)

While when solving as part of the simulations with parameters, we get this from the solver:
Version identifier: <IP_ADDRESS> | 2020-11-10 | 9bedb6d68
CPXPARAM_Emphasis_MIP                            1
CPXPARAM_MIP_Tolerances_MIPGap                   0.01
Tried aggregator 3 times.
MIP Presolve eliminated 24854 rows and 12495 columns.
MIP Presolve added 108 rows and 0 columns.
MIP Presolve modified 4630 coefficients.
Aggregator did 1617 substitutions.
Reduced MIP has 102085 rows, 124488 columns, and 1093674 nonzeros.
Reduced MIP has 34100 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 1.03 sec. (735.24 ticks)
Probing fixed 1270 vars, tightened 400 bounds.
Probing changed sense of 41 constraints.
Probing time = 2.71 sec. (185.18 ticks)
Cover probing fixed 0 vars, tightened 30 bounds.
Tried aggregator 2 times.
Detecting symmetries...
MIP Presolve eliminated 2658 rows and 2728 columns.
MIP Presolve added 2 rows and 0 columns.
MIP Presolve modified 186 coefficients.
Aggregator did 2 substitutions.
Reduced MIP has 99427 rows, 121758 columns, and 1078905 nonzeros.
Reduced MIP has 32738 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 1.49 sec. (1067.84 ticks)
Probing fixed 30 vars, tightened 0 bounds.
Probing time = 1.51 sec. (174.14 ticks)
Cover probing fixed 0 vars, tightened 151 bounds.
Clique table members: 629960.
Tightened 151 constraints.
MIP emphasis: integer feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 8 threads.
Root relaxation solution time = 37.57 sec. (10960.13 ticks)

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

      0     0  7817834.6638  3289                7817834.6638       42
      0     0  8773510.4182  1597                  Cuts: 7767    33588
*     0+    0                       3.58045e+07  8773510.4182            75.50%
      0     0  8918337.8898   756   3.58045e+07    Cuts: 5708    46617   75.09%
      0     0  8965520.7979   527   3.58045e+07    Cuts: 2188    52690   74.96%
*     0+    0                       2.57355e+07  8965520.7979            65.16%
      0     0  -1.00000e+75     0   2.57355e+07  8965520.7979    52690   65.16%
      0     2  8965520.7979   527   2.57355e+07  8965520.7979    52690   65.16%
Elapsed time = 266.30 sec. (100718.31 ticks, tree = 0.02 MB, solutions = 2)
      1     3  8993198.9894   611   2.57355e+07  8966445.0306    55322   65.16%
      2     4  8994688.6932   601   2.57355e+07  8966445.0306    56248   65.16%
      3     5  8994966.9839   607   2.57355e+07  8966445.0306    57024   65.16%
      4     6  8995193.6979   593   2.57355e+07  8966445.0306    62171   65.16%
      5     7  8996435.1007   597   2.57355e+07  8966445.0306    68279   65.16%
      6     8  9004228.9841   600   2.57355e+07  8966445.0306    73001   65.16%
      7     9  9005030.8684   592   2.57355e+07  8966445.0306    76476   65.16%
      8    10  9005422.4586   590   2.57355e+07  8966445.0306    76569   65.16%
      9    11  9005591.5063   584   2.57355e+07  8966445.0306    76854   65.16%
*    10+    1                       2.56001e+07  8966445.0306            64.97%

We should find a way to reduce the performance hit of the formulation that enables RHS updating or a new formulation that will allow RHS update without such a penalty.

This can be resolved with the attributes dict in the Model object.

@jd-lara is there any advantage to updating the RHS of a constraint on a varon variable instead of fixing/unfixing it?
@alefcastelli and I think we have a fix in the formulation for this -- we just want to implement it in the way that is most preferred.

@jd-lara is there any advantage to updating the RHS of a constraint on a varon variable instead of fixing/unfixing it?
@alefcastelli and I think we have a fix in the formulation for this -- we just want to implement it in the way that is most preferred.

I don't think we have tried the approach to fix/unfix in the update code vs setting the value. I would have to check the implementation of the parameter update. My only concern would be if I the model add additional x = val constraints which is kinda solver dependent. We can try it out.


[AutofillGroup] [Web] [Android] Screens starts to jump up and down when keyboard pops with password suggestion

Steps to Reproduce

Run the code sample with the following command (so we are able to debug from a mobile web browser):
flutter run -d web-server --web-port 8080 --web-hostname <IP_ADDRESS>
Open your browser on your android device, under the same network, and go to <your_local_ip>:8080/ (I assume you have 8080 unlocked)
Tap the email field
Dance!

Expected results:
The login form not dancing and making unusable (can't type, close the keyboard, nothing)
Actual results:
https://user-images.githubusercontent.com/6027290/186752131-417cf81d-32b6-4dce-b719-2ae9ca790280.mp4
The form starts jumping up and down.
Code Sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'AutoFill Issue Web Android'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: AutofillGroup(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const <Widget>[
            TextField(
              decoration: InputDecoration(
                labelText: 'Email',
              ),
              autofillHints: [AutofillHints.email],
            ),
            TextField(
              decoration: InputDecoration(
                labelText: 'Password',
              ),
              //autofillHints: [AutofillHints.password],
            ),
          ],
        ),
      ),
    );
  }
}

Flutter doctor output
PS D:\Repos\keybardtest> flutter doctor -v
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1889], locale en-CA)
    • Flutter version 3.0.5 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (6 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at D:\Android
    • Platform android-33, build-tools 30.0.3
    • ANDROID_HOME = D:\Android
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Professional 2019 16.11.10)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
    • Visual Studio Professional 2019 version 16.11.32126.315
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.70.2)
    • VS Code at C:\Users\nosmi\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.1889]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 104.0.5112.102
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 102.0.1245.30

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
PS D:\Repos\keybardtest>

Now, I believe that what's happening here is that because I have it centered in the column, the autofill brings up also a password suggestion on top of the keyboard, repainting the UI (since the bottom inset changed) and trying to re-center the widgets again which causes (I guess) the text suggestion bubble to be in an invalid position, which causes the suggestion to disappear, which makes the password suggestion box above the keyboard go away, which makes the bottom inset change again, which triggers another re-render, which ends in giving focus again to the text field, which pops the suggestion again, repeating the cycle.
I have to mention that if I don't touch the screen for a few seconds the screen stabilizes, after like 5 seconds or so.
If I make the column's main axis alignment to start, this problem doesn't happen, but, the design requires a centered form.
As a work around I have something to detect the bottom inset changes and align to the start when the keyboard is up.

Hi @nosmirck, thanks for filing the issue.
I can reproduce this issue on the latest stable and master channels with provided sample code. The issue is happening on Android Chrome but it works normally on iOS Safari.

Android Chrome: ❌
iOS Safari: ✅

✅: No Issue ❌: Issue reproduced

Demo

Android
iOS

Sample code
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'AutoFill Issue Web Android'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: AutofillGroup(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const <Widget>[
            TextField(
              decoration: InputDecoration(
                labelText: 'Email',
              ),
              autofillHints: [AutofillHints.email],
            ),
            TextField(
              decoration: InputDecoration(
                labelText: 'Password',
              ),
              //autofillHints: [AutofillHints.password],
            ),
          ],
        ),
      ),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.2.1 21D62 darwin-x64, locale en-VN)
    • Flutter version 3.0.5 at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (9 hours ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.69.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos       • darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)     • chrome      • web-javascript • Google Chrome 103.0.5060.114

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

[✓] Flutter (Channel master, 3.1.0-0.0.pre.2501, on macOS 12.5 21G72 darwin-x64, locale en-EE)
    • Flutter version 3.1.0-0.0.pre.2501 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision bd4264b4a0 (5 minutes ago), 2022-08-25 22:43:35 -0400
    • Engine revision 865a240ed8
    • Dart version 2.19.0 (build 2.19.0-139.0.dev)
    • DevTools version 2.16.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13E113
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.70.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 12.5 21G72 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 104.0.5112.101

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Deduplicating with https://github.com/flutter/flutter/issues/107786


Crash on injecting an entry

Expected behaviour:
It should execute a task with injected entry data.
Actual behaviour:
It crashes on any plugin which requests rendering of entry fields, initially noticed on exists_series and telegram plugins in working config. It doesn't crash if I use execute CLI command with mock plugin added to the config as input.
Steps to reproduce:
Inject an entry using CLI:
flexget --test inject FooBar --tasks TEST --dump
Config:
tasks:
  TEST:
#    mock:
#      - {title: FooBar}
    accept_all: yes
    exec: echo "Eureka!"

Log:
(Flexget) D:\devel\projects\flexget\Flexget>flexget --test inject FooBar --tasks TEST --dump
2016-12-10 18:00 INFO     manager                       Test mode, creating a copy from database ...
2016-12-10 18:00 INFO     manager                       Test database created
2016-12-10 18:00 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2016-12-10 18:00 INFO     task          TEST            Plugin exec is not executed because input phase is disabled (e.g. --test)
2016-12-10 18:00 VERBOSE  task          TEST            ACCEPTED: `FooBar` by accept_all plugin
2016-12-10 18:00 VERBOSE  details       TEST            Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2016-12-10 18:00 CRITICAL task          TEST            BUG: Unhandled error in plugin exec: 'NoneType' object has no attribute 'name'
2016-12-10 18:00 CRITICAL manager       TEST            An unexpected crash has occurred. Writing crash report to D:\devel\projects\flexget\Flexget\crash_report.2<IP_ADDRESS>036111000.log. Please verify you are running the latest version of flexget by using "flexget -V" from CLI or by using version_checker plugin at http://flexget.com/wiki/Plugins/version_checker. You are currently using version 2.8.2.dev
2016-12-10 18:00 WARNING  task          TEST            Aborting task (plugin: exec)
2016-12-10 18:00 WARNING  backlog       TEST            No input snapshot available for `FooBar`, using current state
2016-12-10 18:00 INFO     manager                       Removed test database

Additional information:

Flexget Version: 2.8.2.dev / 2.8.1
Python Version: 2.7.10 / 3.5.2
Installation method: Scripts/pip install -e . / pip3 install flexget
OS and version: Windows 8.1 / Linux QNAP253 3.12.6 #1 SMP Wed Nov 2 04:23:31 CST 2016 x86_64 unknown
Link to crash log:

2016-12-10 18:00 DEBUG    manager                       Figuring out config load paths
2016-12-10 18:00 DEBUG    manager                       Adding virtualenv path
2016-12-10 18:00 DEBUG    manager                       Found config: D:\devel\projects\flexget\Flexget\config.yml
2016-12-10 18:00 DEBUG    manager                       Config file D:\devel\projects\flexget\Flexget\config.yml selected
2016-12-10 18:00 INFO     manager                       Test mode, creating a copy from database ...
2016-12-10 18:00 INFO     manager                       Test database created
2016-12-10 18:00 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2016-12-10 18:00 INFO     task          TEST            Plugin exec is not executed because input phase is disabled (e.g. --test)
2016-12-10 18:00 VERBOSE  task          TEST            ACCEPTED: `FooBar` by accept_all plugin
2016-12-10 18:00 VERBOSE  details       TEST            Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2016-12-10 18:00 CRITICAL task          TEST            BUG: Unhandled error in plugin exec: 'NoneType' object has no attribute 'name'
Traceback (most recent call last):
  File "d:\devel\projects\flexget\flexget\flexget\task.py", line 483, in __run_plugin
    return method(*args, **kwargs)
  File "d:\devel\projects\flexget\flexget\flexget\event.py", line 23, in __call__
    return self.func(*args, **kwargs)
  File "d:\devel\projects\flexget\flexget\flexget\plugins\output\exec.py", line 194, in phase_handler
    self.execute(task, 'on_' + phase, config)
  File "d:\devel\projects\flexget\flexget\flexget\plugins\output\exec.py", line 142, in execute
    cmd = render_from_entry(cmd, entrydict)
  File "d:\devel\projects\flexget\flexget\flexget\utils\template.py", line 221, in render_from_entry
    variables['task_name'] = entry.task.name
AttributeError: 'NoneType' object has no attribute 'name'

Changing flexget\utils\template.py:216 to if hasattr(entry, 'task') and entry.task is not None: seems fixed it for me.

Using inject doesn't set the task name. open a different bug on that please


Correction for raw affiliation Chirurgie orthopédique, Hotel-Dieu de France, Beyrouth, Liban

Correction needed for raw affiliation Chirurgie orthopédique, Hotel-Dieu de France, Beyrouth, Liban
raw_affiliation_name: Chirurgie orthopédique, Hotel-Dieu de France, Beyrouth, Liban
new_rors: 04w1m5n60
previous_rors: 03jmjy508
works_examples: W4311983103

This issue was accepted and ingested by the OpenAlex team on 2024-10-10. The new affiliations should be visible within the next 7 days.


Add option to add js code in code editor and link it with new post functionality

I would like to work on this.


Crash loop backoff after cancelling a workflow and reinstalling fission-workflows.

Hi all :)
My workflow fission-function is in long running CrashLoopBackOff after I cancelled a workflow and reinstalled fission-workflows (which I did because I thought the workflow was hanging due to the fission environment being corrupted).
$ fission fn test --name myworkflow
^C
$ helm delete fission-workflows --purge
$ helm install --wait -n fission-workflows fission-charts/fission-workflows --version 0.2.0

I noticed that the workflow function was erroring:
$ kubectl get pods --all-namespaces
fission-function   workflow-adc9c064-53d6-11e8-a99d-080027940780-klfkuk08-68clp2xb   1/2       CrashLoopBackOff   1          17s

$ kubectl logs -n fission-function workflow-adc9c064-53d6-11e8-a99d-080027940780-klfkuk08-68clp2xb -c workflow
goroutine 36 [running]:
github.com/fission/fission-workflows/pkg/types/aggregates.(*WorkflowInvocation).ApplyEvent(0x1afec8d8, 0x1b1183c0, 0x1ac26480, 0x1ac1c048)
        /Users/erwin/go/src/github.com/fission/fission-workflows/pkg/types/aggregates/invocation.go:95 +0x4e6
github.com/fission/fission-workflows/pkg/fes.(*SimpleProjector).project(0x9c920a0, 0x9be43a0, 0x1afec8d8, 0x1b1183c0, 0x1ad6f3c0, 0x8e7f0ef)
        /Users/erwin/go/src/github.com/fission/fission-workflows/pkg/fes/projectors.go:33 +0xcf
github.com/fission/fission-workflows/pkg/fes.(*SimpleProjector).Project(0x9c920a0, 0x9be43a0, 0x1afec8d8, 0x1b04df10, 0x1, 0x1, 0x913ca05, 0xa)
        /Users/erwin/go/src/github.com/fission/fission-workflows/pkg/fes/projectors.go:15 +0x5d
github.com/fission/fission-workflows/pkg/fes.Project(0x9be43a0, 0x1afec8d8, 0x1b111f10, 0x1, 0x1, 0x0, 0x0)
        /Users/erwin/go/src/github.com/fission/fission-workflows/pkg/fes/projectors.go:8 +0x4b
github.com/fission/fission-workflows/pkg/fes.(*SubscribedCache).HandleEvent(0x1afabc50, 0x1b1183c0, 0x1, 0x1)
        /Users/erwin/go/src/github.com/fission/fission-workflows/pkg/fes/caches.go:167 +0x31d
github.com/fission/fission-workflows/pkg/fes.NewSubscribedCache.func1(0x9bea7e0, 0x1ac6c000, 0x1ae286c0, 0x1afabc50)
        /Users/erwin/go/src/github.com/fission/fission-workflows/pkg/fes/caches.go:127 +0x21c
created by github.com/fission/fission-workflows/pkg/fes.NewSubscribedCache
        /Users/erwin/go/src/github.com/fission/fission-workflows/pkg/fes/caches.go:114 +0x10c

Reading through the stacktrace it seems that we're trying to apply a cancel event from the event store to a nil workflow invocation from the cache. So perhaps helm delete deletes the cache but not the store, does that seem correct?
How can I manually reset the event store? I have a snapshot of a VM with fission workflows working, so this isn't a pressing issue for me, but I thought it would be worth making note of.
Kubernetes version 1.10.2
Fission version 0.6.0
Fission Workflows version 0.2.0

Hey @BlakeMScurr, sorry I read over your questions at the end.

So perhaps helm delete deletes the cache but not the store, does that seem correct?

Correct which is by design.

How can I manually reset the event store?

kubectl -n fission get po -o name | grep nats | xargs kubectl -n fission delete

to reset workflows completely without reinstalling it, simply delete the workflows pod afterwards, as it will read the now empty store after restarting. I have this short script for it while developing:
#!/bin/bash

kubectl -n fission get po -o name | grep nats | xargs kubectl -n fission delete
kubectl -n fission-function get po -o name | grep workflow | xargs kubectl -n fission-function delete

Of course this is still a bug, as the workflow engine should not crash fail on past data/invocations. Looking at the trace, I think 0.3.0 fixes this issue.
If you get around testing it, could you verify whether this bug is still present?

@erwinvaneyk I am on the latest version of the fission (0.10) and fission workflows (0.5) and I got similar (probably the same) error when I increase the concurrency
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x8347f9]

goroutine 73 [running]:
github.com/fission/fission-workflows/pkg/types/aggregates.(*WorkflowInvocation).ApplyEvent(0xc4202feb00, 0xc4202cc000, 0x16, 0x7f3b40bd76c8)
	/go/src/github.com/fission/fission-workflows/pkg/types/aggregates/invocation.go:92 +0x349
github.com/fission/fission-workflows/pkg/fes.(*SimpleProjector).project(0x1eff3a0, 0x16655c0, 0xc4202feb00, 0xc4202cc000, 0xc420638b58, 0x835a8a)
	/go/src/github.com/fission/fission-workflows/pkg/fes/projectors.go:33 +0xe7
github.com/fission/fission-workflows/pkg/fes.(*SimpleProjector).Project(0x1eff3a0, 0x16655c0, 0xc4202feb00, 0xc42054bbe8, 0x1, 0x1, 0xc4202feae0, 0x0)
	/go/src/github.com/fission/fission-workflows/pkg/fes/projectors.go:15 +0x6d
github.com/fission/fission-workflows/pkg/fes.Project(0x16655c0, 0xc4202feb00, 0xc420638be8, 0x1, 0x1, 0x0, 0x0)
	/go/src/github.com/fission/fission-workflows/pkg/fes/projectors.go:8 +0x5f
github.com/fission/fission-workflows/pkg/fes.(*SubscribedCache).ApplyEvent(0xc42061e7c0, 0xc4202cc000, 0x1, 0x1)
	/go/src/github.com/fission/fission-workflows/pkg/fes/caches.go:218 +0x40a
github.com/fission/fission-workflows/pkg/fes.NewSubscribedCache.func1(0x16651c0, 0xc4205b8000, 0xc42042c2c0, 0xc42061e7c0)
	/go/src/github.com/fission/fission-workflows/pkg/fes/caches.go:175 +0x276
created by github.com/fission/fission-workflows/pkg/fes.NewSubscribedCache
	/go/src/github.com/fission/fission-workflows/pkg/fes/caches.go:161 +0x16c

@thenamly thanks for your update on this issue. From your description, your issue sounds unrelated to this issue: invalid invocations preventing recovery of the engine. Can you share a bit more details on your setup?

workload/concurrency
workflow
the logs preceding this error.


Arcade freezes sometimes when copy/pasting blocks

Describe the bug
Duplicating the overlap handler will completely freeze the website. I've run into this issue on two different projects, but can't repro it consistently
To Reproduce
Steps to reproduce the behavior:

Import this project: https://makecode.com/_eoW4t9cipLjf
Copy the overlaps handler (Ctrl-C)
Paste the block (Ctrl-V)
Everything freezes. Can't refresh, can't delete. The only want to recover is to close the tab and reopen a new one

Desktop (please complete the following information):

OS: Windows
Browser Chrome
Version 85

I can't repro this

Okay I ran into this again today, but this time I was actually recording a video when it happened!

it happened again when refreshing the same tab, but not after closing and opening a new tab. I'll keep this bug open and try to update if I can get logs / a better repro

Are there any exceptions in F12

I'm trying to repro it with it open. Currently whenever this happens, I can't open up the DevTools window since it's mega frozen :(

No repro.


fix(deis-builder-rc.yaml): remove DOCKERIMAGE env var

requires https://github.com/deis/builder/pull/43

This change has broken installation of the alpha release.  It's a change to the environment variables passed with the container, without any change to the image.
We should probably avoid updating the deis manifests right now and instead only update deis-dev.  When we have our beta release, deis-dev manifests can probably replace deis manifests wholesale.

ugh, my bad. the v2-beta image is changed, but not the official alphas. reverting now

@arschles thanks.


DarkTheme property added to CupertinoApp Widget

Description
Hello,
I have added the darkTheme property featured in the MaterialApp widget to the CupertinoApp widget to take advantage of automatic detection of system-wide dark mode. This is especially useful for iOS developers who use the CupertinoApp widget if they want their app to automatically change themes depending on the system's theme. Note that I am not an experienced flutter developer nor am I especially familiar with the internal workings of the engine.
Related Issues
darkTheme property lacking from CupertinoApp widget
Tests
I added the following tests:
hello_world test succeeded
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] I signed the CLA.
[x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
[x] I read the Tree Hygiene wiki page, which explains my responsibilities.
[x] I updated/added relevant documentation (doc comments with ///).
[x] All existing and new tests are passing.
[x] The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
[x] I am willing to follow-up on review comments in a timely manner.

Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.

[x] No, no existing tests failed, so this is not a breaking change.
[ ] Yes, this is a breaking change. If not, delete the remainder of this section.

[ ] I wrote a design doc: https://flutter.dev/go/template Replace this with a link to your design doc's short link
[ ] I got input from the developer relations team, specifically from: Replace with the names of who gave advice
[ ] I wrote a migration guide: Replace with a link to your migration guide

Re opening soon.


SameDiff/Libnd4j - multiple c++ op issues

I'm going to use this as a summary/burndown list of known problems, in no particular order.
More to come.

Issue 1: broadcast_dynamic_shape
~~https://github.com/deeplearning4j/deeplearning4j/issues/6322~~
Confirmed fixed: 08/04/2019

Issue 2: zeta
~~https://github.com/deeplearning4j/deeplearning4j/issues/6182~~

~~Issue 3: Strided slice empty arrays not shape with 0s
Returning invalid shape - [0] not empty.
https://gist.github.com/AlexDBlack/afb4e65cc2f218452fa550d86419386c~~
Update 09/04/2019: confirmed fixed

~~Issue 4: space_to_batch / batch_to_space
https://github.com/deeplearning4j/deeplearning4j/issues/6447~~
Note: I'm assuming our space_to_batch is equivalent to tensorflow's space_to_batch_nd (which is what tf's space_to_batch uses internally anyway)
space_to_batch test case - https://gist.github.com/AlexDBlack/df902f07033e909b1f8f18ae86bd18e6
Confirmed passing 08/04/2019

Issue 5: Choice Op
Choice seems to always return the last value.
~~https://gist.github.com/AlexDBlack/601b14c7ae73b08923b93423189cefda~~
See also, RngValidationTests.validateRngDistributions()
Update 08/04/2019: seems to be bad test (mixed float/double arrays)

Issue 6: Mirror Pad
~~https://gist.github.com/AlexDBlack/ffa70545d4289359fddac19a83dd151a~~
Test cases are identical to: https://www.tensorflow.org/api_docs/python/tf/pad
(note that tf.pad with symmetric/reflect modes maps to our mirror pad op)
Edit: rank 1 + reflect case issue - https://gist.github.com/AlexDBlack/fe43ea2c32d08f04eb3f204a17b53202

Issue 7: Reverse (rank 1 edge case)
From TF import. Most cases pass fine, with default of isLegacy (iArg[0] == 1) (most fail with iArg[0]=0, so I don't think it's just that, but I'm not exactly sure what the behaviour difference here is).
~~https://gist.github.com/AlexDBlack/d3cc4b247dc38b756793d8d31bb43c63~~

Issue 8: Resize bilinear op edge case
Blocker for importing 2 deeplab models.
~~https://gist.github.com/AlexDBlack/102ec696421f8ec2bd3f4bf67f2c7030~~

Issue 9: Dynamic linspace required
Still not implemented: https://github.com/deeplearning4j/deeplearning4j/issues/6723

Issue 10: LogMatrixDeterminant should also output sign
The TF docs for the logdet (LogMatrixDeterminant) op don't actually match the schema:
https://github.com/deeplearning4j/deeplearning4j/blob/a2176bed41440203ce7f660d84759064cd59b931/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/resources/ops.proto#L15632-L15658
Specifically, the LogMatrixDeterminant op should output both the sign and the absolute value; in the case of TF logdet op both exist in the graph (i.e., both are calculated) but only the value variable is returned to the user in the public API (sign is calculated but ignored from perspective of user when creating graph).
https://www.tensorflow.org/api_docs/python/tf/linalg/logdet

Issue 11: BinCount op should support min/max as dynamic array args
~~Mainly for TF import.
Currently, optional min/maxLength args can only be specified as integer args; for TF import they need to be settable via (optional) array args.
https://github.com/deeplearning4j/deeplearning4j/blob/master/libnd4j/include/ops/declarable/generic/parity_ops/bincount.cpp#L49-L53
https://www.tensorflow.org/api_docs/python/tf/math/bincount~~
Update 08/04/2019: Looks like this was added at some point.

Issue 12: Gather shape can be wrong (rank 1 not rank 2)
~~https://gist.github.com/AlexDBlack/0e4b18d2459de122697ec412faacb9a7~~

Issue 13: Nth element
~~https://gist.github.com/AlexDBlack/2885f71ce6dca1c578f63667a10f0617~~
Update 08/04/2019: confirmed fixed

~~Issue 14: strided_slice validation issue
https://www.tensorflow.org/api_docs/python/tf/strided_slice~~

If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1, taking on the value at index begin[i]. end[i] and strides[i] are ignored in this case.

~~In our implementation, end[i] and strides[i] validation is still occurring when shrink_axis[i] is 1
https://gist.github.com/AlexDBlack/1a94e55c4bc5ac1482a9d3b001722869~~
Update 09/04/2019: confirmed fixed

Issue 15: Where op
~~https://www.tensorflow.org/api_docs/python/tf/where
Another case where TF behaviour doesn't match docs.
For Where op, if only the "condition" arg is provided, the condition tensor can be non-boolean. If it is non-boolean, it returns the coordinates of the non-zero elements.
https://gist.github.com/AlexDBlack/ca38538082804ff3085a8baff4ae2e38~~
Update 08/04/2019: confirmed fixed

Issue 16: LRN differences
2 failing test cases, "lrn/dr3_b05_a05_b02" and "lrn/dr5_b1_a1_b05"
Reproducible with these TF import tests in ND4J, but this needs to be isolated further if possible...

Issue 17: Loss function failures
Abs_diff weighted sum: https://gist.github.com/AlexDBlack/bd7efe5a5a150ca1359834947a12df55
Seems correct for weighted mean (iarg(0)=2), but also fails for "weighted_sum_by_nonzero_weight" (iarg(0)=3)
Also huber, similarly returning 0.0: https://gist.github.com/AlexDBlack/23832ab6af03071e9f861d20747d7ec1
Also sigmoid cross entropy returning 0.0... https://gist.github.com/AlexDBlack/c4701bc132ef8cbc0b4f57889b2fe11d
https://github.com/deeplearning4j/deeplearning4j/pull/7031

Issue 18: extract_image_patches does not match TF
If I had to guess, I think this is just a difference in order in which we're stacking along the depth dimension.
Now passing, 27/02/2019: ~~https://gist.github.com/AlexDBlack/0e7370c10f27c4c38f1f32260279995b~~
20/02/2019: Looks like we still have some more work to do here:
Confirmed passing - 08/04/2019

Issue 19: Unsorted Segment Prod Backprop
~~https://github.com/deeplearning4j/deeplearning4j/issues/6952~~

Issue 20: Local Response Normalization gradient check failure
Updated 27/02/2019: still failing after recent PR/changes, but looks closer - https://gist.github.com/AlexDBlack/51b1b9099c93d0c43fdffef929b5dd4c
nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/autodiff/opvalidation/LayerOpValidation.java#L278-L280
https://gist.github.com/AlexDBlack/241d74002c68dc9dcffa339267272bf0
Edit: also fails to match DL4J LRN implementation (difference is quite big).

Issue 20: Tensor Mmul - Wrong Shape
https://gist.github.com/AlexDBlack/cc88d18e6f1562e54363b8893961cc36
See also: https://github.com/deeplearning4j/deeplearning4j/issues/7262
Aha! Link: https://skymindai.aha.io/features/ND4J-14

Closing as mostly resolved and otherwise outdated


update launcher formatting to match formatting used for streaming rh daemon logs

#1465  👈 (View in Graphite)
main

This stack of pull requests is managed by Graphite. Learn more about stacking.


Invalid option for mac os

Looks like the script doesn't work on Mac OS
I am receiving error ->
./scripts/utils/checkbox.sh: line 416: read: -N: invalid option read: usage: read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [name ...]

Unfortunately i don't have access to a Mac
But i'm shure that together we can solve this problem
The actual 416 line is echo -en "  $footer\n"
But seeing the error it looks like it happened on one of those lines
IFS= read -sN1 key 2>/dev/null >&2
read -sN1 -t 0.0001 k1
read -sN1 -t 0.0001 k2
read -sN1 -t 0.0001 k3

Please send me the contents of line 416, so i can be sure
But in my analysis i'm considering that the error is on one of those lines
Comparing the docs of the command read on:

linux: https://ss64.com/osx/read.html
mac: https://linuxcommand.org/lc3_man_pages/readh.html

I can see mac don't have the -N option

Description of the option on linux: -N nchars return only after reading exactly NCHARS characters, unless EOF is encountered or read times out, ignoring any delimiter

But both OS have the -n option,

Description of the option on mac: -n nchars read returns after reading nchars characters rather than waiting for a complete line of input
Description of the option on linux: -n nchars return after reading NCHARS characters rather than waiting for a newline, but honor a delimiter if fewer than NCHARS characters are read before the delimiter

Maybe change -sN1 to -sn1 solve the problem
I think this won't break anything in the script because the delimiter option (-d) of the command read is not used on this script
Try change this code:
IFS= read -sN1 key 2>/dev/null >&2
read -sN1 -t 0.0001 k1
read -sN1 -t 0.0001 k2
read -sN1 -t 0.0001 k3

For this:
IFS= read -sn1 key 2>/dev/null >&2
read -sn1 -t 0.0001 k1
read -sn1 -t 0.0001 k2
read -sn1 -t 0.0001 k3

In my tests, the script worked well
OS: Ubuntu 20
Terminal: Terminator
Shell: Bash
If this solve your problem i'll make a pull request with this change
Otherwise, we continue the investigation

I merged the possible solution on master
Now you just need pull and test
And like i said: I think this won't break anything in the script because the delimiter option (-d) of the command read is not used on this script
So don't need to use the N option

Hi,
This is how it looks like now on MacOs Catalina
\e[2K\e[37m--------------------------------------------------
\e[2K\e[34m    [ ] Option 1
\e[2K\e[37m    [ ] Option 2
\e[2K\e[37m    [ ] Option 3
\e[2K\e[37m    [ ] Option 4
\e[2K\e[37m    [ ] Option 5
\e[2K\e[37m    [ ] Option 6
\e[2K\e[37m    [ ] Option 7
\e[2K\e[37m    [ ] Option 8
\e[2K\e[37m    [ ] Option 9
\e[2K\e[37m    [ ] Option 10
\e[2K\e[37m    [ ] Option 11
\e[2K\e[37m    [ ] Option 12
\e[2K\e[37m    [ ] Option 13
\e[2K\e[37m    [ ] Option 14
\e[2K\e[37m    [ ] Option 15
\e[2K\e[37m    [ ] Option 16
\e[2K\e[37m    [ ] Option 17
\e[2K\e[37m    [ ] Option 18
\e[2K\e[37m    [ ] Option 19
\e[2K\e[37m    [ ] Option 20
\e[2K\e[37m    [ ] Option 21
\e[2K\e[37m    [ ] Option 22
\e[2K\e[37m    [ ] Option 23
\e[2K\e[37m    [ ] Option 24
\e[2K\e[37m    [ ] Option 25
\e[2K\e[37m    [ ] Option 26
\e[2K\e[37m    [ ] Option 27
\e[2K\e[37m    [ ] Option 28
\e[2K\e[37m    [ ] Option 29
\e[2K\e[37m    [ ] Option 30
\e[2K\e[37m--------------------------------------------------
  1/30

@andreysmyntyna thanks for the feedback,
I'll search more about ANSI colors on mac and think in a solution.
I think if the script is running on your MacOs Catalina says that the @ajainvivek problem's has been solved.
Can you test for me, please? Just to make sure
Change this code:
IFS= read -sn1 key 2>/dev/null >&2
read -sn1 -t 0.0001 k1
read -sn1 -t 0.0001 k2
read -sn1 -t 0.0001 k3

For this:
IFS= read -sN1 key 2>/dev/null >&2
read -sN1 -t 0.0001 k1
read -sN1 -t 0.0001 k2
read -sN1 -t 0.0001 k3

I believe that if the script stops working, with this change, but works with the master branch code, then the first problem was solved

@pedro-hs
Hi,
I would suggest to utilise AWS to gain an access to a MacOS instance.
https://aws.amazon.com/ru/blogs/aws/new-use-mac-instances-to-build-test-macos-ios-ipados-tvos-and-watchos-apps/
I believe that it will be a productive way to debug the script :-)

Thanks @andreysmyntyna


[tests] Add test covering client responses

Q
A

Branch
master

Bug fix?
no

New feature?
no

BC breaks?
no

Deprecations?
no

Tests pass?
yes

Fixed tickets
n/a

License
MIT

Doc PR
n/a

These tests cover the issue reported at #2298.

Thanks @phansys !


Cannot convert from DotNet  to DotNet

Describe the bug
Visual Studio Code is showing errors like "Cannot convert from DotNet  to DotNet " and also packaging the extension is failing because of this. Specifically we have for example
Argument 3: cannot convert from 'DotNet "System.Net.ICredentials"' to 'DotNet "System.Net.NetworkCredential"'AL(AL0133)
in the MarketingSetup.Page.al file.
Unfortunately the same MarketingSetup.Page.al works for a colleague, but he's having different errors of the same type.
To Reproduce
There are not really any specific steps to reproduce. Just open the Base Application extension in VS Code. Depending on the machine it may work or give different kinds of errors.
Probing paths:
"al.assemblyProbingPaths": [
"./.netpackages",
"C:/Program Files/Microsoft Dynamics 365 Business Central/150/Service",
"C:/windows/assembly"
],
Expected behavior
No errors of this kind.
5. Versions:

AL Language: 4.0.199169
Business Central: 15.0.36510.0

It seems to be related to Issue 5421, but copying the dlls of the .net framework into the .netpackages folder in the Extension doesn't seem like a solution

Hi @janhofmann24, we have found the issue - when you have two assemblies of different versions these can't convert between one another. We have a fix which will be included in the next minor release. For now - try making sure that your assemblyProbingPaths only contains one version of the DLL and that all your dependents on that DLL are compiled against the version you provide there.

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 38136 and VS Code Extension Version 5.0.200428.
If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo
For more details on code branches and docker images please read:
https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/
https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/


PhoneID sending as parameter in sendMessage instead of client config

Title is self explanatory but..
Have you wondered about making the phoneID as parameter of send message instead of obtained from client?
Think this would enable to have multiple phones under the same service, also making sure that the user gets responded from the same number it has interacted.
Is there any design decision behind making setting up this from client?

Hi @tecoad,
Sorry for the late response, this week has been really busy. 😩
So I've been thinking about your suggestion, and tbh I never really though of such case. I guess the design decision was due to the fact that several requests need the phoneId. So, to not be passing it around all the time, which would be rather uncomfortable, it made sense to pass it once while instantiating it. Though I do realize now that this come with the limitation of having multiple numbers.
However, couldn't you easily solve it by instatiantion a client per phone. And then, based on the phoneId you get on the message, which you can get from the message metadata, you would call the respective client.

@MarcosNicolau

So, to not be passing it around all the time, which would be rather uncomfortable, it made sense to pass it once while instantiating it.

Thats exact what i though you had in mind.

However, couldn't you easily solve it by instatiantion a client per phone. And then, based on the phoneId you get on the message, which you can get from the message metadata, you would call the respective client.

Exactly what i did! Created a function around it passing the phoneId.
If you allow me, another thing i noticed is missing in the package is the ability to fetch a media.
downloadMedia doesn't work if you are working on serverless environment (my case), since fs is not available.
So i have to fetch the media and buffer it to manipulate its data.
So i extended the client with this new method.
class ExtendedBABAClient extends WABAClient {
  async fetchMedia(mediaUrl: string) {
    const response = await this.restClient.fetch(mediaUrl, {
      responseType: "arraybuffer",
    });
    return {
      data: response.data,
      filetype: response.headers["content-type"],
    };
  }

Wonder someone might need that in the future aswell.
But if you think this make sense would love to submit a PR.
Btw, were you able to check the keys to fix the building?

Oh yes, please send a pr for that!
I tried to renew the keys but for some reason, my account got suspended and I didn't have time to investigate why.

Hi @tecoad,
I've been trying to get my keys but meta is taking their time for it...
I'll probably just create a new account for it and if I can't I will just push the your changes manually (without running the tests 😅).
Btw, I'd love to see the pr for the feature you mentioned.

@tecoad I ended up deactivating the client tests for now to push the new changes. Idk how much time will meta take to validate my account... :disappointed:
Anyway, I am closing this issue. Please feel free to open a new one if you encounter any issues, and thank you very much for your recent contributions! :smiley:


add term tracker items to oeo-physical

this just adds a bunch of term tracker items to oeo-physical.
I went through the ontology and through closed pull-request to add as much as I could find.
As I already went through oeo-model and oeo-social this will close #259.

nice :)


feat(render): support pseudo-transparency

This adds pseudo-transparency for the background of the bar and the
background of the systray.
Here's how it lools (systray is on the right edge, after the power symbol):

I've submitted the PR now to get some feedback on the general implementation, there's still a few small cleanup tasks to do:

[ ] Cleanup tray changes
[ ] Check behaviour with compositing enabled.

@jaagr any comments?

@beenofs sorry for my extreme delay. I have a few comments, will open up a review as soon as I can.

@jaagr no problem, take your time. Just wanted to make sure this didn't get lost, as I often forget about PRs myself when I only take a short look at them and then github notification is gone ☺

This feature is currently not compatible with a bottom aligned bar.

@lmoesch oh? what happens in that case? i had assumed that m_rect would be the correct rect for a bottom alligned bar as well

The background area is still copied from the top of the background, not the bottom. I tried to modify the values of "copy_area_checked" within the background_manager wich did the trick. So basically we need to get the corner point information to that function.

@lmoesch background_manager stores a m_rect that specifies the target location from which the background should be copied. It is passed to it in via the activate method, so we just need to make sure we pass it the right values there.

@lmoesch should be fixed with last commit.

Splendid, that worked like a charm! Thanks for the quick fix 👍

While fiddeling arround with some parameters I came across other bugs.
First thing is, that the offset of a border is not taken into account while calculating the background snippet. Unfortunately I have just few to no knowledge about X-Server classes and behaviour, but I assume that a border is also drawn by a rectangle which gets overdrawn by the content. So to fix this one I guess it is sufficient to replace the bar rectangle with the border rectangle.
Other thing is noticed is, that offset parameters are not working anymore [neither global/wm offset nor bar offset]. The background is drawn here from the right position, but the bar stays at the same place.
Not sure if this is an issue with this commit, or some general bug (or misconfiguration of my setup).
Last thing is a trickey one. When using multiple bars ontop of each other, background location also fails due to the offset to each other. (e.g. if you have two bars on top, than both will have the background of the most upper one)

@lmoesch
Borders work correctly now: (this is a semi-transparent border at top)

Have to look into the "multipe bars stacked" issue.

Btw, I am not sure anymore what I originally meant by "Cleanup try changes"

Ok, fixed the second issue as well

Hope I haved missed any configuration :)

Rebased against latest master

I have changed to using brace initialization. The tray works fine for me, but alpha support in the tray is dependent on the tray icon having alpha channel I think. What program have you tried, maybe it is specific to that program that it does not work (does it work if using a compositor)? I am using udiskie which has a tray icon and that it works there for me.
Yes we need a detection method. I will look into that. But with the changes, it should be pretty easy to turn of the pseudo-transparency if there is a compositor: right now, we fill the surface with the desktop background as a first step and then paint everything on top of that, using cairo's support for transparency. If we have a compositor, we can simply drop the first step and paint the window fully transparent, everything else should keep working.

I've tried nm-applet and yakyak (an Electron app) and both result in an opaque background, with and without compton.

@NBonaparte hmm, if I use the example config and change background to #BB222222 everything is semi-transparent for me. Were you using tray-background?

It works for me even when using tray-background (if tray-background is set, it takes precendence over background and is used instead of it) or tray-transparent (which will cause the tray to become 100% transparent)

I tried with and without tray-background, and it just gives me an opaque color. With #BB222222 I get the color #191919.

What window manager, desktop, distribution are you using? You're using the default config except for changing the background color, right? I can't reproduce this here.

Using bspwm, Arch Linux, default config with background = #BB222222 results in this:

Hmm, are you setting a background image? I use feh --bg-fill /path/to/desktop/background.jpg

Yeah, using nitrogen. The rest of the bar looks like

That is very weird. I just launched bspwm, then used nitrogen --set-scaled --random /some/dir and after that, launched polybar from terminal with background set to #22FFFFFF (used this color since the bg image was very dark so the effect is better seen with a white semi-transparent background) and I got this:

Everything is neatly transparent...

@patrick96 Could you test this out and see if the tray pseudo-transparency works?

I have two icons on the tray: dropbox and f.lux.
The tray background itself is fully transparent and the dropbox icon takes the bar transparent background (when compton is running) and the f.lux icon uses a fully transparent background
With compton:

Without compton:

This is the config I used:
[colors]
background = #44222222
foreground = #dfdfdf

[bar/example]
monitor = ${env:MONITOR:HDMI-0}
width = 100%
height = 27
radius = 6.0

background = ${colors.background}
foreground = ${colors.foreground}

border-size = 4
border-color = #00000000

padding-left = 0
padding-right = 2

modules-left = text

tray-position = right
tray-padding = 2
tray-transparent = true
tray-background = ${colors.background}

[module/text]
type = custom/text
content = " "

; vim:ft=dosini

If I remove the tray-transparent key, I get the following, which looks much better:
With compton:

Without compton:

So without the tray-transparent key and with compton running, things look pretty good on my system.

Any update on getting this merged? Would love to use it.

@AndreasBackx Since there is no real interest in merging this, just fork the main branch and merge this request into it yourself - atleast thats what I did.

@lmoesch Same.

@patrick96 @NBonaparte any chance to get this merged? or are there things I need to change before this is ready?

Hi, sorry for the radio silence. This is quite a big PR and I don't have the knowledge to fully understand everything you're doing here, I also don't have the time to do so. I will need to rely on lots of manual testing to make sure it works properly instead of looking for issues in the code. Don't worry we haven't forgotten about this, but there is a lot of things that needs tending right now, so things just kinda get pushed onto the TODO stack.
I cannot promise you that I will look at this in the next week, but it's on my TODO list.
I have one question right away: Polybar already has some transparency functionality, but I know, it's not perfect. What does this PR achieve? Can you please quickly outline what transparency problems that polybar had before are being fixed by this PR

Thanks for the quick response! I will try to summarize the changes here:
The transparency functionality that polybar already supports relies on a compositing manager. It sets the background of the window to a (semi-) transparent color and then some compositing manager is needed to compose that with the actual background.
The problem with that is if you don't use a compositing manager (and many users of minimal window managers don't), then windows with semi-transparent background simply don't work. What you can do however, and this is what the PR here implements, is simply rendering the whole bar directly against the X11 desktop background. So this PR changes the rendering to first render the background (in the pseudo-transparent case, the background is taken from the desktop background) and then rendering all the bar elements above that (using cairo's compositing algorithms to achieve transparency). The window itself does not have a transparent background this way so it also works without a compositing manager. The tradeoff here is that it won't take into account any other windows except the root window's background, so if you move a floating window below the bar then you cannot see that "through the bar" with pseudo-transparency (while with real transparency).

This also means that the tray background wasn't working properly for us, because it's supposed to work without compositors. Maybe we should try to resolve that issue first.

So that would mean with this patch, we would have pseudo-transparency, even if we had a compositor running, right? If so, how feasible would it be to implement a config option that allows a user to disable pseudo-transparency and use the compositor for transparency?
@NBonaparte from what I found in https://github.com/jaagr/polybar/pull/595#issuecomment-354495390, the tray background works with this patch, even without compton (except for transparent tray icons), as long as you remove the tray-transparent key. Or were you referencing the icons themselves not being drawn transparently?

Yeah, the icon background still isn't transparent if not using a compositor (which I assume would be the most common use case).

Is it even possible to render the icons with an alpha channel, without using a compositor? At least without writing lots of code.

On second thought, I think this probably might be a case of Qt icons acting funny in the case of Dropbox (see #854), so we likely won't be able to fix it.

I'm not around until the 22nd of july. I will test this once I get back, as soon as I can.

Ok. I have now implemented some of the suggested changes:

I removed tray-transparent. The tray background color can now be set to any color with alpha values.
There is a new option pseudo-transparency in [settings] that controls whether the bar uses pseudo transparency or real transparency (default is real transparency)
The tray uses pseudo-transparency in all cases. Changing this would be an invasive change that requires a lot of testing (I don't know if all applications support the _NET_SYSTEM_TRAY_VISUAL property). The tray is going to be refactored sometime in the future anyway (#913) so I decided to not spend too much time on this issue.

My exams are starting next week, so I don't have that much time right now. I haven't forgotten about this though.

Just finally tested this and it really looks awesome now, the tray blends in perfectly. Will do some more testing and also do an actual code review.

Nice, I am hoping to see implementation for this

I forked the repo and merged this PR. Pseudo-transparency in the bar is working but the system tray doesn't seem to be transparent. Is anyone's tray pseudo-transparency working for them? Here is my partial config:
[settings]
pseudo-transparency = true

[bar/menu]
monitor = DVI-D-0
monitor-fallback = LVDS1
bottom = true
width = 100%
height = 32

background = #00000000
foreground = #ccffffff

line-color = #00000000
line-size = 2

spacing = 3
padding-right = 2
module-margin-left = 0
module-margin-right = 4

font-0 = NotoSans-Regular:size=8;0
font-1 = unifont:size=6;-3
font-2 = FontAwesome:size=8;-2
font-3 = NotoSans-Regular:size=8;-1
font-4 = MaterialIcons:size=10;-1
font-5 = Termsynu:size=8:antialias=false;0

modules-left = i3
modules-right = wireless-network battery volume date

tray-position = right
tray-maxsize = 22
tray-background = #00000000

@tgharib I can reproduce this. Will investigate later, I have some exams this week.
But it looks like this is somehow dependent on whether the bar is bottom or not (it works if you set bottom = false for me)

@tgharib can you check with the latest commit applied? I think it should fix your issue

Codecov Report

Merging #595 into master will decrease coverage by 52.11%.
The diff coverage is 0.58%.

@@            Coverage Diff             @@
##           master    #595       +/-   ##
==========================================
- Coverage    57.9%   5.78%   -52.12%
==========================================
  Files          24     162      +138
  Lines         734    9023     +8289
==========================================
+ Hits          425     522       +97
- Misses        309    8501     +8192

Flag
Coverage Δ

#unittests
5.78% <0.58%> (-52.12%)
:arrow_down:

Impacted Files
Coverage Δ

include/x11/connection.hpp
0% <ø> (ø)

include/components/bar.hpp
100% <ø> (ø)
:arrow_up:

src/components/controller.cpp
0.27% <0%> (ø)

src/components/renderer.cpp
0.24% <0%> (ø)

src/components/parser.cpp
0.94% <0%> (ø)

include/cairo/font.hpp
0% <0%> (ø)

src/x11/tray_manager.cpp
0.16% <0%> (ø)

include/components/types.hpp
7.5% <0%> (ø)

include/events/signal.hpp
0% <0%> (ø)

src/components/bar.cpp
0.19% <0%> (ø)

... and 149 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 028b141...65723d0. Read the comment docs.

It works now! :)

Thanks for the feedback! I believe issue 3 is impossible to fix, if my theory about why it occurs is correct:

i3 resizes the bar window to full screen width
without a compositing manager, there is no way to set the window bg color to transparent so you will see black

As the window is enlarged by i3, we can't really fix that (we request a smaller window, so to fix it we would need to draw outside of the window).
I'll look into the other issues.

Thought as much for i3, it really doesn't seem to like polybar. Best practice is to use override-redirect with a full-length fully transparent bar below, so this shouldn't be an issue

I might want to try this in bspwm and see if the same issue presist like i3

@Banbeucmas I already did, it doesn't happen there.

@patrick96 ah ok. Thanks for the info :D

@patrick96 the commit I pushed just now should fix both issues. additionally it also reduces the amount of changes, I don't know why I didn't implement it like that in the first place :)
Can you verify that it works? I will make another commit with docs/comments afterwards

Everything seems to check out now :smiley:

@patrick96 added comments. should be finished now

I'm sorry, I found another thing:
When the bar displays no text at all and compton isn't running, the bar is always drawn fully opaque.
[bar/example]
background = #99000000
foreground = #dfdfdf

modules-left = title

[module/title]
type = internal/xwindow
label =

[settings]
pseudo-transparency = true

; vim:ft=dosini

I noticed this because the xwindow module displays nothing when no window is focused and I had a bar with only the xwindow module on it.

@patrick96 good catch, thanks for testing this so thoroughly! The issue is that fill_background uses compositing-background as compositing mode which defaults to source, thereby overwriting our background image.
What's the intended purpose of "compositing-background"? Isn't the background supposed to be "the lowest layer", so there's nothing to composite against?

To be honest, I have no idea why it's set to source, all the other settings use over and indeed with over we don't have that problem. As far as I can tell the change to source was made in 3e4a4ce78f3de0081de594940a2a65aede91f990, I don't know why though.
I also don't know what the purpose of compositing-background in general is, I think this was before my time. @jaagr can you shed some light on this?
We could probably force compositing-background = over if pseudo-transparency is enabled.

@patrick96 i believe source makes sense in the non-pseudo-transparent case, since the surface may have undefined contents at that point (?) so compositing might produce unwanted effects. I don't see why one would want to set this to anything other than "SOURCE" though in the non-pseudo-transparent case.
I have pushed a commit that defaults compositing-background to over if using pseudo-transparency. If somebody really wants to use source with pseudo-transparency, they can still do that but polybar will print a warning in that case.

This feature is fantastic and long overdue! Can't wait to get this merged, @bennofs amazing job! polybar is the only reason I'm forced to use a compositor.

@NBonaparte can you do a quick sanity check review on this to make sure I didn't miss anything major.

Ah, I think it was the compositing-background changes that broke it.

@patrick96 I have pushed a new commit that should hopefully fix this. It also means I don't have to change anything about compositing_background, so the part about the message is also solved this way.
Please take your time to test this, according to my own tests all examples you gave should work now but as history shows this appears to be tricky to get right. :grimacing:

Awesome! I think we're done. I'm going to wait a week on NBonaparte's for feedback but after that we'll merge this.

After only 17 months we have finally merged this!
@bennofs, thank you so much for all your hard work, we really appreciate it. This is a really exciting feature to have!
Would you be available to help out if problems arise with this feature?

Thanks! You can ping me in any issues related to this.

Awesome! Let's hope we won't need to ;)

@patrick96 @bennofs Finally, congratulations.

Thank you so much for this!

Thank you guys for your work!

Thank you so much for this!! @bennofs you are amazing!

Can confirm. @bennofs any idea how to fix this? I was able to get transparency back by adding the offset to both the x and y arguments here (cairo_set_source_surface(*m_context, *surface, -x, -y);). But that gives me the background of wherever the tray would be without offset. Is it even possible to get the background for areas that are not covered by the bar?

I will look into this when I have time (probably right after new year, possibly earlier)

No rush :)

Looks like setting an offset x value for the tray breaks the transparency : example

The example file seems to have gone away. Can you restore it / upload to github?

Didn't know then I could just paste a clipped image, here you go.

Ok. What exactly is the intended behaviour of that? The space that is "left over" due to the x/y movement should be filled with the bar's background as well?

I think the intended behavior should be that the whole tray has a transparent background even the parts that do not overlap the bar window.
I think the gap that the tray leaves doesn't need to be filled.

Should be fixed by #1571


Fail to proxy behind Apache when selecting language

Describe the bug
Hello! I'm using docker version of PiGallery2 behind a Apache2 server. The PiGallery is proxied as a sub url - the docker exposes port 8084, and relavent Apache2 config includes:
AllowEncodedSlashes NoDecode
ProxyPass /pigallery http://localhost:8084 nocanon

And the urlBase is set to /pigallery, so the app is on http://<host-ip>/pigallery
Everything is fine except when I select a language, the url is redirected to http://<host-ip>/cn rather than http://<host-ip>/pigallery/cn. The developer's tool (F12) of my Edge browser also shows that the href fails to be proxied correctly:

   cn
   de
   ...

When I visit http://<host-ip>/pigallery/cn directly, it redirects me to http://<host-ip>/?ln=cn. The language seems to have changed when I go back to the previous URL and refresh.
Is that a bug?
Environment (please complete the following information):

OS: server on Ubuntu 20.04 LTS, browser on Win10
Browser: Edge chromium

Used app version: docker latest

Thanks for the report!
Last commit should fix this.

Closing this due to inactivity