Http Client DELETE Method Doesn't Add query Parameters

Laravel Version: 9.52.4
PHP Version: 8.2.3
Database Driver & Version:

MySQL 8.0.29

Description:
$this->getHttpClient()
            ->withUrlParameters([
                'node' => $this->node->cluster,
                'server' => $this->server->vmid
            ])
            ->delete('/api2/json/nodes/{node}/qemu/{server}', [
                'destroy-unreferenced-disks' => true, 'purge' => true, 'skiplock' => true,
            ])
            ->json();

The Laravel HTTP Client doesn't appear to add the payload in the second argument to the delete method as query parameters to the request. Though, I am not completely sure that this is the case from my superficial analysis (I can't seem to make sense of the Http Client's code nor am I getting enough information from the dd method on the Http Client to properly determine the issue).
When I send the request to the API service (Proxmox Virtual Environment), I receive a HTTP error 501. Here's the contents of the dd method on the Http Client. Information like the base_uri and any confidential information was redacted and filled with placeholder data.
array:13 [ // vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php:1102
  "connect_timeout" => 5
  "http_errors" => false
  "timeout" => 15
  "verify" => false
  "base_uri" => "https://redacted.com:8006/"
  "laravel_data" => array:3 [
    "destroy-unreferenced-disks" => true
    "purge" => true
    "skiplock" => true
  ]
  "on_stats" => Closure($transferStats)^ {#5048
    class: "Illuminate\Http\Client\PendingRequest"
    this: Illuminate\Http\Client\PendingRequest {#5019 …}
  }
  "synchronous" => true
  "handler" => GuzzleHttp\HandlerStack^ {#5033
    -handler: Closure(RequestInterface $request, array $options): PromiseInterface^ {#5039
      returnType: "GuzzleHttp\Promise\PromiseInterface"
      class: "GuzzleHttp\Handler\Proxy"
      use: {
        $default: Closure(RequestInterface $request, array $options): PromiseInterface^ {#5026 …}
        $streaming: GuzzleHttp\Handler\StreamHandler {#5036 …}
      }
    }
    -stack: array:7 [
      0 => array:2 [
        0 => Closure(callable $handler): callable^ {#5040
          returnType: "callable"
          class: "GuzzleHttp\Middleware"
          use: {
            $bodySummarizer: null
          }
        }
        1 => "http_errors"
      ]
      1 => array:2 [
        0 => Closure(callable $handler): RedirectMiddleware^ {#5041
          returnType: "GuzzleHttp\RedirectMiddleware"
          class: "GuzzleHttp\Middleware"
        }
        1 => "allow_redirects"
      ]
      2 => array:2 [
        0 => Closure(callable $handler): callable^ {#5042
          returnType: "callable"
          class: "GuzzleHttp\Middleware"
        }
        1 => "cookies"
      ]
      3 => array:2 [
        0 => Closure(callable $handler): PrepareBodyMiddleware^ {#5043
          returnType: "GuzzleHttp\PrepareBodyMiddleware"
          class: "GuzzleHttp\Middleware"
        }
        1 => "prepare_body"
      ]
      4 => array:2 [
        0 => Closure($handler)^ {#5045
          class: "Illuminate\Http\Client\PendingRequest"
          this: Illuminate\Http\Client\PendingRequest {#5019 …}
        }
        1 => ""
      ]
      5 => array:2 [
        0 => Closure($handler)^ {#5046
          class: "Illuminate\Http\Client\PendingRequest"
          this: Illuminate\Http\Client\PendingRequest {#5019 …}
        }
        1 => ""
      ]
      6 => array:2 [
        0 => Closure($handler)^ {#5047
          class: "Illuminate\Http\Client\PendingRequest"
          this: Illuminate\Http\Client\PendingRequest {#5019 …}
        }
        1 => ""
      ]
    ]
    -cached: Closure($request, array $options)^ {#5060
      class: "GuzzleHttp\Middleware"
      use: {
        $handler: GuzzleHttp\RedirectMiddleware {#5059 …}
        $bodySummarizer: null
      }
    }
  }
  "cookies" => GuzzleHttp\Cookie\CookieJar^ {#5049
    -cookies: []
    -strictMode: false
  }
  "allow_redirects" => array:5 [
    "max" => 5
    "protocols" => array:2 [
      0 => "http"
      1 => "https"
    ]
    "strict" => false
    "referer" => false
    "track_redirects" => false
  ]
  "decode_content" => true
  "idn_conversion" => false
]

Although MDN specifies that a DELETE request may have a body, it seems like many (from my limited search) prefer to use query parameters over using a body.
A workaround I am using is:
$this->getHttpClient(options: [
            'query' => [
                'destroy-unreferenced-disks' => true,
                'purge' => true,
            ]
        ])
            ->withUrlParameters([
                'node' => $this->node->cluster,
                'server' => $this->server->vmid
            ])
            ->delete('/api2/json/nodes/{node}/qemu/{server}')
            ->json();

I don't feel like this is an ideal workaround and would love to use the expressive syntax of Laravel.
Here are links to the code containing the mentioned snippets.

The code where I sent the request with the payload in the delete method
The code where I sent the request with the workaround
getHttpClient

Steps To Reproduce:

A reproduction is possible by running
$httpClient = Http::withOptions([
            'verify' => false,
            'base_uri' => "https://YOUR_DOMAIN/",
            'timeout' => 15,
            'connect_timeout' => 5,
            'headers' => [
                'Authorization' => 'DUMMY AUTHORiZATION HEADER',
                'Accept' => 'application/json',
                'Content-Type' => 'application/json',
                'User-Agent' => null,
            ],
        ]);

$httpClient->delete('/route', [
    'query-parameter' => 'test'
]);

If you want a complete reproduction, please install my app using my documentation. It uses Docker containers and the installation process is mostly copy-paste with few interventions to add your desired configuration.
Since my app interacts with an external service, you need to also create a VM, dedicated server, or bare metal that's running (Proxmox Virtual Environment). If you have my app APP_ENV to production, make sure you generate trusted TLS certificates on the Proxmox Virtual Environment server.
You can then add the Proxmox node to my app using these documentation.

have you tried this?
$url = "/api2/json/nodes/{$this->node->cluster}/qemu/{$this->server->vmid}?destroy-unreferenced-disks=true&purge=true&skiplock=true";

$response = $this->getHttpClient()
    ->withUrl($url)
    ->json();

Hello, I did think about that solution but it just doesn't seem right or elegant given the style of its other features, like Url parameter binding, method utilities like withOptions, withBody, etc.
I plan on also making the query parameters vary based on arguments because this HTTP request is running inside of a reusable function, so the solution you proposed is not a very great workaround.
I would love to contribute a pull request but the code for the http client is confusing to understand-at least for me.

I took a look in the code and saw that by default the $data array that you pass with the queries in the delete method is sent as a json to the Guzzle library to handle it ["json" => $data]:
public function delete(string $url, $data = [])
{
    return $this->send('DELETE', $url, empty($data) ? [] : [
        // bodyFormat will be "json"
        $this->bodyFormat => $data,
    ]);
}

So the Guzzle library will create a request with a json as body.
In the other hand, the get method sends the data as a query:
public function get(string $url, $query = null)
{
    return $this->send('GET', $url, func_num_args() === 1 ? [] : [
        'query' => $query,
    ]);
}

Maybe a solution would be to add an optional third parameter to the delete method that tells whether you want to send the request as a query string or using a json body.

Http::bodyFormat('query')->delete('your-url', [
    'param1' => 'hello',
    'param2' => 'world',
]);

@ericwang401 I think that's probably the best solution and I would guess there's a very slim chance of an accepted PR where there's another argument added to the PendingRequest@delete() method.

@ericwang401 I think that's probably the best solution and I would guess there's a very slim chance of an accepted PR where there's another argument added to the PendingRequest@delete() method.

I see. I think that is a fair solution! I was also concerned about how the elegant syntax would need to be changed.
Thank you for your feedback!

Think we can close this one. Thanks


Depoly documentation only from stable branch

Release updates stable branch and every time stable branch is changed a PR to master is created ( or updated if exisits)

It'd be great if we had a way to push the latest website somewhere (like at https://scala-cli.virtuslab.org/latest/), to have a preview of it. But I guess we can work on that later.

Agree. I shouldn't be that hard to do I think. I can add it once this is completed and validated.


Update jira.rst

Added a note to make sure to log in and join the channels as the user you will be using.

Thanks @apophisnow for the pull request!
Per the CONTRIBUTING.md file displayed when you created this pull request, we need to add you to the list of approved contributors for the Mattermost project.
Please help complete the Mattermost contribution license agreement?
This is a standard procedure for many open source projects. Your form should be processed within 24 hours and reviewers for your pull request will be able to proceed.
Please let us know if you have any questions.
We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

This problem was caused by an improper json request. No need to log in and join channels.

Thanks @apophisnow! And no worries, glad we figured out what the issue was.
Appreciate following up on this


[QUESTION] Non-English words/characters not showing in PDF

Prerequisites

[x] Have read and understood: https://github.com/Maatwebsite/Laravel-Excel/blob/3.1/.github/SUPPORT.md
[X] Checked if your Laravel Excel version is still supported: https://docs.laravel-excel.com/3.1/getting-started/support.html#supported-versions
[X] Checked that your question isn't already asked before.
[X] Filled in the entire issue template

Versions

PHP version: 7.3.1
Laravel version: 5.8.*
Package version: 3.1

Description

i have different language in my database other than English. in my case Bengali Language.
when i export xlsx, it works fine, and the bengali words shows just as normal.
but when i export to PDF, i get ?????? (for dompdf) and '[][][][][][]' (in mpdf) instead of actually bengali words. i have tried with both mpdf and dompdf. for example,

how can i solve this for pdf ?

Chinese language has the same problem

i find a wiki  https://github.com/dompdf/dompdf/wiki/UnicodeHowTo

Indeed see https://github.com/dompdf/dompdf/wiki/UnicodeHowTo
Closing it, as it's not an issue with our package.


release-2.2 mutual tls config key and peer property key not matching

Here is the extraction from my connection profile:

"peers":{
"peer0": {
"tlsCACerts": {
"path": "./tls/tlscacerts/tlsca.pem",
"client": {
"certfile": "./tls/signcerts/sign.pem",
"keyfile": "./tls/keystore/key.pem"
}
},
"url": "grpcs://xx.xx.xx.xx:7051"
}
},

and here is the code:
`Path walletDirectory = Paths.get("wallet");
Wallet wallet = Wallets.newFileSystemWallet(walletDirectory);
    // Path to a common connection profile describing the network.
    Path networkConfigFile = Paths.get("connection_profile.json");

    // Configure the gateway connection used to access the network.
    Gateway.Builder builder = Gateway.createBuilder()
            .identity(wallet, "admin")
            .networkConfig(networkConfigFile);

    // Create a gateway connection
    try (Gateway gateway = builder.connect()) {

        // Obtain a smart contract deployed on the network.
        Network network = gateway.getNetwork("dev");

        Contract contract = network.getContract("fabcar");

    } catch (ContractException e) {
        e.printStackTrace();
    }`

The problem happens at 2 places. The first one is:
 .networkConfig(networkConfigFile);
where in NetworkConfig.java, it will put in props the key 'tlsClientKeyFile'.
`if (keyfile != null) {
props.put("tlsClientKeyFile", keyfile);
}
            if (certfile != null) {
                props.put("tlsClientCertFile", certfile);
            }`

See https://github.com/hyperledger/fabric-sdk-java/blob/v2.2.19/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L845.
This change was introduced since v2.2.4.
Then it goes on to the line:
Network network = gateway.getNetwork("jasmy-dev");
where, in Endpoint.java, it tries to find 'clientKeyFile' in the properties
if (properties.containsKey("clientKeyFile") || properties.containsKey("clientCertFile")) {
See https://github.com/hyperledger/fabric-sdk-java/blob/v2.2.19/src/main/java/org/hyperledger/fabric/sdk/Endpoint.java#L175
Since the property has a different name, the method return null, which results on the peer side returning an error saying the client didn't send the certificate.

By changing the code in NetworkConfig.java to mache the certFile and keyFile key names, it works. I have tested with my local fix.
`if (keyfile != null) {
props.put("clientKeyFile", keyfile);
}
            if (certfile != null) {
                props.put("clientCertFile", certfile);
            }`

This looks like something that has never worked, and perhaps wasn't intended to. The change you refer to just introduced some new functionality and didn't change any existing property naming set by NetworkConfig. It seems by happy coincidence that it would provide the capability you are looking for too though.
The Endpoint code is picking up properties set either explicitly if nodes are programmatically added, or from configuration and/or environment variables when nodes are added by service discovery, here:

Peer: https://github.com/hyperledger/fabric-sdk-java/blob/4d3cfc581c963ecc790bb429c6fe4a78e3312294/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L1696-L1713
Orderer: https://github.com/hyperledger/fabric-sdk-java/blob/4d3cfc581c963ecc790bb429c6fe4a78e3312294/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L1630-L1649

Your suggested enhancement seems reasonable, although I think "tlsClientKeyFile", "tlsClientCertFile", "tlsClientKeyBytes" and "tlsClientCertBytes" would all need to change to the forms without the leading "tls" to match the Endpoint code. Note that these properties are also used in HFClient, here:
https://github.com/hyperledger/fabric-sdk-java/blob/4d3cfc581c963ecc790bb429c6fe4a78e3312294/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java#L1620-L1630
I think the changes required would be:

[ ] Change "tlsClient..." properties set in NetworkConfig to "client...".
[ ] Change the corresponding property names in HFCAClient.
[ ] Some unit testing (at least in NetworkConfigTest).
[ ] Extract the strings hard-coded in all these locations to internal constants, probably in Endpoint

Would you like to implement these changes?

Happy to do so.

@bestbeforetoday I have made the changes, but it seems that I can't create a new pull request. Could you have a look?
https://github.com/irririki/fabric-sdk-java-260

[X] Change "tlsClient..." properties set in NetworkConfig to "client...".
[X]  Change the corresponding property names in HFCAClient.
[X]  Some unit testing (at least in NetworkConfigTest). -  NetworkConfigTest and HFCAClientTest.java
[X]  Extract the strings hard-coded in all these locations to internal constants, probably in Endpoint - except HFCAClient

[WARNING] Tests run: 444, Failures: 0, Errors: 0, Skipped: 5
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  35.443 s
[INFO] Finished at: 2023-02-07T12:14:03+09:00
[INFO] ------------------------------------------------------------------------

I think the problem might be that your repository is not a fork if this repository. The repository with your changes needs to be a fork of the repository to which you want to propose changes by creating a pull request. See the GitHub documentation on how to fork a repo. Then the documentation on creating a pull request from a fork.


MAINT: Migrate from Yahoo and Google APIs to Quandl

Yahoo has suffered large breaks in the API with no stable replacement. Our current backup, Google, has not been stable since late 2017. Both these errors are upstream, with pandas-datareader, which they are currently trying to fix.
In the meantime, we are using the Quandl API to fetch returns data.
Note that users must make a free Quandl account in order to get an API key. This API key must then be set as an environment variable. In bash, this can be done simply by running export QUANDL_API_KEY='quandl_api_key'. Without an API key, users may only make up to 50 calls a day, and will not have access to data on certain tickers (most notably SPY).
Clearly, this is an undesirable position to be in: this should be considered a temporary fix until Yahoo or Google Finance transition to more stable APIs, and pandas-datareader starts supporting them again.
Closes #89. Thanks to @jaycode for authoring most of this!

It turns out you need a Quandl API key in order to read SPY returns, among other tickers. Also, without an API key, users are limited to 50 calls per day. I've updated the main description with this info.


broccoli-browserify/watchify unification

Hello, I am working to try and unify all the various broccoli browserify plugins.
I just released broccoli-watchify (i still hope to eventually merge that effort into broccoli-browserify) 1.0.0 which includes:

caching
stable outputs
no work, if no browserify related files or dependencies changed
browserifies files in their inputTree rather then realpath of their symlink (this lets it behave nicely in broccoli land. (likely fixes: https://github.com/caleb/broccoli-fast-browserify/issues/15)
works with latest broccoli (like fixes: https://github.com/caleb/broccoli-fast-browserify/issues/19)
just passes all options through to browserify (likely fixes: https://github.com/caleb/broccoli-fast-browserify/issues/21)
source-maps work (fixes #13)

I would love to work with you to merge these projects. Let me now if this is interesting.

I would love to be able to forward users to a more up-to-date plugin. The project I developed this for is over, and I am not even doing much JS right now.
Let me know when the work is done and I will put a notice up telling people to go to your plugin.

1.0.0 of broccoli-watchify is out, should be good to start pointing people that way. https://github.com/eploko/broccoli-watchify/
Still working on getting broccoli-browserify itself, hopefully soon :)


chore(main): release 0.40.9

:robot: I have created a release beep boop
0.40.9 (2024-11-07)
Bug Fixes

bump doctrine/data-fixtures from 1.7.0 to 1.8.0 (#944) (0ffdc33)
bump nesbot/carbon from 3.8.0 to 3.8.1 (#940) (8459ad1)
bump phpdocumentor/reflection-docblock from 5.4.1 to 5.5.0 (#942) (f61d6e0)
bump phpdocumentor/reflection-docblock from 5.5.0 to 5.5.1 (#947) (ec7b061)
bump phpdocumentor/type-resolver from 1.8.2 to 1.9.0 (#939) (d956592)
bump the symfony group with 14 updates (#945) (6006652)
bump zenstruck/browser from 1.9.0 to 1.9.1 (#943) (8ea9f10)
bump zenstruck/foundry from 2.2.1 to 2.2.2 (#946) (bb1ba83)
Fix error pages not recording (#948) (51b7d3d)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

0.40.9
:sunflower:


Review cbuild setup flow for Reference Applications

The Problem To Be Solved
Explore the complete user end-to-end scenario with Reference Examples.
When a user starts with a reference application (i.e. Sensor SDK) it should be assumed that no pack is installed on the local computer. On the local computer only the reference application (csolution.yml) is there that refers to some packs (i.e. NXP::ISSDK) in the cproject.yml and is configured for a board (with BSP and DFP pack references).
The user (or IDE) steps so far:

Obtained the information about the example and the board via a web interface and downloaded the example.
Entered board information to csolution.yml
Installed DFP/BSP for the board (or entered the pack references to the csolution.yml).

Then the command cbuild setup *.csolution.yml --update-rte --packs --context-set is used to:

Download any missing packs
Identify the compiler to be used
Identify the layers to be used

The user (or IDE) can then add this missing information to the *.csolution.yml.
The next step could be:

Verify setup with cbuild setup *.csolution.yml --update-rte --packs --context-set
Build project with cbuild *.csolution.yml --update-rte --packs --context-set

Does this flow make sense?
We should also consider an offline mode where packs are not download (--packs option not applied).
What error messages are issued to the user in case of missing packs. Can these be displayed nicely in an IDE?

For the command cbuild setup I was expecting the argument --update-rte enabled by default, as agreed in https://github.com/Open-CMSIS-Pack/devtools/issues/1265.
Was it intentionally kept optional?

I was not aware that option defaults for cbuild depend on a command, hence I used explicitly --update-rte.
Should we really make defaults different depending on a command?

It has been requested that the build operation should not touch user input files/directories, due to the fact when consumed by an online build service the user workspace has read-only permissions.
On the other hand as part of project management, and therefore before the building phase, the csolution convert updates RTE files by default.
This has been the behaviour historically. Of course it's not written on stone and can be changed if there is a good reason.
However having cbuild setup as a mandatory step in the workflow and having the update-rte behaviour as it was agreed previously, the suggested calls sequence could be simplified:
Verify setup with cbuild setup *.csolution.yml --packs --context-set (does the update-rte implicitly)
Build project with cbuild *.csolution.yml --context-set (RTE files and packs are already updated in the setup phase)

This is implemented.


Borrowing only possible after scanning QR code

As a user, I can only borrow the item after I scanned the QR code. If I have not scanned the QR code before, I cannot borrow
Dependencies
Depends on:

#11
#67

Estimation: S


Fixes #53 - Adding WYSYWIG and page model, controller, views and migrate

Fixes #53 ; refs #53
Adding WYSYWIG and page model, controller, views and migrate
Changes proposed in this pull request:

Added page model, controller, views and migrate
Added rspec tests
Added WYSYWIG support
Added access control for pages action.

@ucsdlib/developers - please review

Coverage increased (+0.3%) to 87.272% when pulling<PHONE_NUMBER>6a7b0598a012e508b9eee4619c20ea on feature/WYSYWIG_PAGES into 091c741d1af51ac4806d38511e439248a7c8309b on develop.

@mcritchlow All requested changes has been added to https://github.com/ucsdlib/horton/pull/79/commits/06770812616a7b0598a012e508b9eee4619c20ea,
Could you take a look and let me know if it looks fine to you. Thanks!

Coverage increased (+0.3%) to 87.272% when pulling<PHONE_NUMBER>6a7b0598a012e508b9eee4619c20ea on feature/WYSYWIG_PAGES into 091c741d1af51ac4806d38511e439248a7c8309b on develop.

Coverage increased (+0.3%) to 87.272% when pulling<PHONE_NUMBER>6a7b0598a012e508b9eee4619c20ea on feature/WYSYWIG_PAGES into 091c741d1af51ac4806d38511e439248a7c8309b on develop.

👍

👍


Fix ISO for Fedora 40 and add Fedora 40 CI

We currently cannot build Fedora 40 ISO because we require lorax-templates-rhel everywhere. Let's parametrize it based on the distribution. Also, let's add Fedora 40 tests.
Fixes #421

Hm, I guess with that we can close https://github.com/osbuild/bootc-image-builder/pull/458 ?

Fwiw, when playing with this I noticed that we print errors twice and I added https://github.com/osbuild/bootc-image-builder/pull/490

@mvo5 two of your comments are already addressed in my PR that's been open for a while for the kickstart :laughing:
https://github.com/osbuild/bootc-image-builder/pull/438/files#diff-fe10eed01f41cd3896fdc1ab8512f5df015b415b8e98bac6219bc2eb25f0e92fR207-R211

@mvo5
After this is merged, I still can not build out federao:40 iso using below command:
[root@dell-xx-17 ~]# sudo podman run --rm -it --privileged --pull=newer --security-opt label=type:unconfined_t -v /var/lib/libvirt/images/output:/output -v /var/lib/libvirt/images/config.json:/config.json   quay.io/centos-bootc/bootc-image-builder:latest  --type anaconda-iso --tls-verify=true  --config /config.json  quay.io/fedora/fedora-bootc:40  --chown 107:107 --rootfs ext4
Generating manifest manifest-anaconda-iso.json
No match for argument: lorax-templates-rhel
error install_specs
MarkingErrors: Error occurred when marking packages for installation: Problems in request:
missing packages: lorax-templates-rhel
Error: cannot build manifest: cannot depsolve: DNF error occurred: MarkingErrors: Error occurred when marking packages for installation: Problems in request:
missing packages: lorax-templates-rhel
2024/06/29 00:00:58 error: cannot build manifest: cannot depsolve: DNF error occurred: MarkingErrors: Error occurred when marking packages for installation: Problems in request:
missing packages: lorax-templates-rhel

I wonder what changes I need to do if I want to build federo:40 successfully?

quay.io/centos-bootc/bootc-image-builder

Thank you for testing this and sorry for my slow reply! We had an issue with quay.io/centos-bootc/bootc-image-builder not getting updated for a while (this iss getting fixed right now). I tried your commandline and still get the same error. The container contains a bootc-image-builder:
-rwxr-xr-x 1 root root 62981296 May 20 06:57 /usr/bin/bootc-image-builder

which is quite old. The issue to follow is under https://github.com/osbuild/bootc-image-builder/issues/503


Needs to be updated to CustomCommandsConfig.FromSubscription

In section "3. Add the following code to the method body of InitializeDialogServiceConnector" replace " DialogServiceConfig.FromSpeechCommandsAppId" with "CustomCommandsConfig.FromSubscription"
See reference:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.dialog.customcommandsconfig?view=azure-dotnet

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 34c2a7bb-da4c-659c-42b9-732eb8d96826
Version Independent ID: b0e49ed5-efc8-b2c1-e5a9-124134f8ae3d
Content: Quickstart: Connect to a Custom Commands app with Speech SDK - Speech Service - Azure Cognitive Services
Content Source: articles/cognitive-services/Speech-Service/quickstart-custom-speech-commands-speech-sdk.md
Service: cognitive-services
Sub-service: speech-service
GitHub Login: @donkim
Microsoft Alias: donkim

@dargilco Thanks for the feedback. We are investigating the issue and will update you shortly.

@dargilco I've raised a #PR with this change in the doc that's awaiting review.

PR merged and fixing version issue here: https://github.com/MicrosoftDocs/azure-docs-pr/pull/103831
#please-close


How to use Router?

When using v5::Router as the publish service, how can I access the path wildcard matches in the handler?

what is your router code looks like?
in general, you can access matches via https://docs.rs/ntex-mqtt/0.6.4/ntex_mqtt/v5/struct.Publish.html#method.topic
and Path::get()  https://docs.rs/ntex-router/0.4.2/ntex_router/struct.Path.html

That is amazing! I just assoomed that .topic() would just return &str or something anemic like that.
1. However, I don't think I understand how router nesting should be carried out.
.publish(v3::Router::new(default_service.clone()).resource(
    "{one}/{tail}*",
    v3::Router::new(default_service).resource(
        "{two}/{tail2}*",
        fn_factory_with_config(|ses: v3::Session<MySession>| {
            println!("{:?} {:?}", ses.sink(), ses.state());
            ok::<_, MyServerError>(fn_service(
                async move |publish: v3::Publish| {
                    println!("wow, a special publish!\n{:?}", publish);
                    for (k, v) in publish.topic().iter() {
                        println!("{}: {}", k, v);
                    }
                    Ok(())
                },
            ))
        }),
    ),
)))

for "hello/1/2/3" produces
one: hello
tail: 1/2/3
two: 2
tail2: 3

Changing "{one}/{tail}*" to "{one}/*" does the same (but doesn't name tail at all). How would I get a named segment that matches 1 in this case?
2. Is there a way to create a middleware that wraps a Router or a any other... ServiceFactory(?) that could filter or mutate a request before it's passed to the inner type? Maybe there's an example in a non-mqtt-specific repo?
3. Has anyone attempted at least a naive implementation of a somewhat compliant mqtt broker using this networking facade? Something that actually stores subscriptions and routes messages based on that? Notably, this would probably involve getting an MqttSink from the Handshake and registering it in some BrokerRouter "agent"(?) which should also be addressable from MySession to be configured in a control message service?

router couldn't be used for broker, nesting is not supported as well. broker must implement its own routing.

router couldn't be used for broker, nesting is not supported as well. broker must implement its own routing.


made change

a better and easy C change

I appreciate the change; however, I fail to see how this is better or easier. Could you elaborate?
It seems to me like the new version you have submitted removed the bubble_sort() and print_range() functions and instead placed everything entirely in main()`. In this case, keeping these functions seems to be more readable.
In addition, because you are asking for input from the user, it is more difficult to tell or test the code input and output without running the code. This is a book and we focus on readability over interactivity.

I agree with @leios but I would also like to add something important; the point of the bubble sort function is for people to read just the C implementation of bubble sort and to take when they need it for their work.

Yeah the bubble sort function is existent, so that you can just read the actual code without any Console Print or other clutter. It is also just good practice in general.
Since this PR introduces the mentioned issues, I close it.

I am a beginner my friend so for me it was a bit easier and better.and
thanx for ur support .
btw where're you from?
On Thu, Oct 4, 2018 at 9:38 AM James Schloss<EMAIL_ADDRESS>wrote:

I appreciate the change; however, I fail to see how this is better or
easier. Could you elaborate?
It seems to me like the new version you have submitted removed the
bubble_sort() and print_range() functions and instead placed everything
entirely inmain()`. In this case, keeping these functions seems to be
more readable.
In addition, because you are asking for input from the user, it is more
difficult to tell or test the code input and output without running the
code. This is a book and we focus on readability over interactivity.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/algorithm-archivists/algorithm-archive/pull/441#issuecomment-426878693,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Apzjk-0-15HUzZy4z560cJ_3E049pWhOks5uhYmkgaJpZM4XHUkM
.

@varunyo If you want to talk to people more casually, please, join the discord.


[Communication calling] - selectMicrophone causes Uncaught (in promise) TypeError: this._telemetryLogManager is undefined

Package Name:  @azure/communication-calling
Package Version: 1.29.1, 1.28.4, 1.26.2

Describe the bug
After starting or joining room call and calling .selectMicrophone error triggers and microphone does not get changed.
Uncaught (in promise) TypeError: this._telemetryLogManager is undefined
    audioSourceChanged sdk.bundle.js:96
    emit sdk.bundle.js:95
    emit sdk.bundle.js:95
    _audioSourceChangedSub sdk.bundle.js:95
    raiseChanged sdk.bundle.js:72
    raiseEvents sdk.bundle.js:72
    raiseEvents sdk.bundle.js:72
    raiseChanged sdk.bundle.js:72
sdk.bundle.js:96:236229
    audioSourceChanged webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:96
    apply self-hosted:2292
    emit webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:95
    emit webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:95
    _audioSourceChangedSub webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:95
    raiseChanged webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    raiseEvents webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    forEach self-hosted:160
    raiseEvents webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    raiseChanged webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    notifyStreamChange webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    notifyChange webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    forEach self-hosted:1880
    notifyChange webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    onSelectedDevicesChanged webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    deviceManagerSubscriptions webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    _raiseEventImpl webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    raiseEvents webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    forEach self-hosted:160
    raiseEvents webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    _raiseEventImpl webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    raise webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    selectDevices webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    selectDevices webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    selectDevices webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:72
    selectMicrophone webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:96
    value webpack-internal:///./node_modules/@azure/communication-calling/dist/sdk.bundle.js:81
    get webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js:194
    withAsyncErrorTeedToState webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallContext.js:926
    InterpretGeneratorResume self-hosted:1420
    next self-hosted:1341
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallContext.js:25
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallContext.js:21
    withAsyncErrorTeedToState webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallContext.js:924
    onSelectMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js:129
    InterpretGeneratorResume self-hosted:1420
    next self-hosted:1341
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js:19
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js:15
    onSelectMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js:125
    setMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:583
    InterpretGeneratorResume self-hosted:1420
    next self-hosted:1341
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:38
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:34
    setMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:582
    asyncTeeErrorToEventEmitter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:1084
    InterpretGeneratorResume self-hosted:1420
    next self-hosted:1341
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:38
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:34
    asyncTeeErrorToEventEmitter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:1082
    setMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:582
    InterpretGeneratorResume self-hosted:1420
    next self-hosted:1341
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:38
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:34
    setMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js:581
    onSelectMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js:89
    InterpretGeneratorResume self-hosted:1420
    next self-hosted:1341
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js:19
    __awaiter webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js:15
    onSelectMicrophone webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js:88
    onClick webpack-internal:///./node_modules/@azure/communication-react/dist/dist-esm/react-components/src/components/DevicesButton.js:134
    executeItemClick webpack-internal:///./node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.base.js:551
    onItemClickBase webpack-internal:///./node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.base.js:522
    _onItemClick webpack-internal:///./node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuItemWrapper.js:26
    React 19
    forEach self-hosted:4288
    React 16

To Reproduce
Steps to reproduce the behavior:

Setup call and start or join to room call
Select microphone with .selectMicrophone(newMicrophone)

Expected behavior
Microphone to be changed without error
Additional context
Tested with Azure calling sample app (https://github.com/Azure-Samples/communication-services-web-calling-hero) and with my own application.
This error does not happen in version 1.23.2.
This error does not happen BEFORE joining the room so user can change microphone without error before joining.

thank you for reporting , we'll look into it asap and update here

Hi @rsanteri, after our investigation, we were able to reproduce this error message, but our test showed that microphone switch did happen successfully. I have made the change to remove this error, and the fix will be in the next release version once testing is completed


fix: parse dtd end tag should not be strict

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.79%. Comparing base (92d074c) to head (54f76cc).

Additional details and impacted files
@@            Coverage Diff             @@
##           master       #9      +/-   ##
==========================================
+ Coverage   93.77%   93.79%   +0.02%
==========================================
  Files           2        2
  Lines         273      274       +1
==========================================
+ Hits          256      257       +1
  Misses         12       12
  Partials        5        5

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


There is a missing safety comment in bevy_render

How can Bevy's documentation be improved?
bevy_render::view::window has a fairly large unsafe block with no safety comment.
https://github.com/bevyengine/bevy/blob/9e8de2aa94fd345b556542717e3ef8464150cc4a/crates/bevy_render/src/view/window.rs#L240-L242
The unsafe operation is render_instance.create_surface(…) (https://docs.rs/wgpu/latest/wgpu/struct.Instance.html#method.create_surface).

The unsafe block could be limited to create_surface, the rest of the unsafe block doesn't uphold any invariants related to create_surface
There should be a safety comment explaining why the RawWindowHandle passed to create_surface are valid. (to be fair, this seems particularly tricky, since I don't see any definition of "valid" in the wgpu doc)

Fixed by #10646


msdn_crawler.py not working on IDA for Linux (6.95)

Hello,
I have tried generating the the XML database file using the msdn_crawler.py on a Linux machine (Ubuntu 16.04 x64) and it seems to have failed with the following errors (for both tilib and tilib64)
python ./MSDN_crawler/msdn_crawler.py "/home//extracted1033/" "/opt/bin/ida-6.95/tilib" "/opt/bin/ida-6.95/til/pc"
MSDN crawler based on zynamics msdn-crawler - Copyright 2010
WARNING:til_extractor:Error calling tilib.exe with /opt/bin/ida-6.95/til/pc/nlm.til -- Command '['/opt/bin/ida-6.95/tilib', '-l', '/opt/bin/ida-6.95/til/pc/nlm.til']' returned non-zero exit status 126
...SNIP...
WARNING:til_extractor:Error calling tilib.exe with /opt/bin/ida-6.95/til/pc/ntapi.til -- Command '['/opt/bin/ida-6.95/tilib', '-l', '/opt/bin/ida-6.95/til/pc/ntapi.til']' returned non-zero exit status 126
Traceback (most recent call last):
File "./MSDN_crawler/msdn_crawler.py", line 413, in
main()
File "./MSDN_crawler/msdn_crawler.py", line 398, in main
(file_counter, results) = parse_files(msdn_directory, tilib_exe, til_dir)
File "./MSDN_crawler/msdn_crawler.py", line 357, in parse_files
const_enum = extract_til_constant_info.main(tilib_exe, til_dir)
File "/opt/bin/flare-ida-master/MSDN_crawler/extract_til_constant_info.py", line 95, in main
for enum_name, enum in enums.iteritems():
UnboundLocalError: local variable 'enums' referenced before assignment
I have also tried with the Windows version of IDA and failed like others have pointed out in other issue threads.
MSDN crawler based on zynamics msdn-crawler - Copyright 2010
Traceback (most recent call last):
File "MSDN_crawler\msdn_crawler.py", line 413, in
main()
File "MSDN_crawler\msdn_crawler.py", line 398, in main
(file_counter, results) = parse_files(msdn_directory, tilib_exe, til_dir)
File "MSDN_crawler\msdn_crawler.py", line 371, in parse_files
result = parse_file(os.path.join(root, file), const_enum)
File "MSDN_crawler\msdn_crawler.py", line 276, in parse_file
return parse_new_style(file, content, const_enum)
File "MSDN_crawler\msdn_crawler.py", line 183, in parse_new_style
parsed_html.find_all(width='60%')]
TypeError: 'NoneType' object is not callable
I tried obtaining the modified version of the crawler and already generated database but it's no longer there.

I was able to partially fix the first issue by removing the shell=True (line 55), in the extract_til_constant_info.py file and the second issue by changing the import from beautifulsoup3 to beautifulsoup4
from bs4 import BeautifulSoup
inside the msdn_crawler.py file and explicitly defining the html.parser as it was complaining
parsed_html = BeautifulSoup(descriptions[i], 'html.parser')
The problem I'm facing now is that the generated XML database file does not contain any <value> entries which ultimately leads to no constants being renamed in the IDB file when run with the plugin. Is that because I'm using beautifulsoup4 or any of my modifications?

The script hasn't been tested on Linux and there are other existent issues you've already discovered. Can you please check if the following file works for you after unzipping it?
https://github.com/mr-tz/flare-ida/blob/master/MSDN_data/msdn_data.zip

Thanks for getting back to me so quickly. I tried with your database file but had only a few constant values resolved to their names. At the same time there's no error reported in IDA's python console (except the missing information for few insignificant functions) so I'm not sure where the glitch is.

Great, it sounds like the plugin is running successfully now. It's likely that it won't rename all constants automatically. For some it might miss the MSDN information (which you can provide in additional data files in the data directory) and for some it might fail to track the arguments correctly.

Unfortunately this is not the case. It was able to resolve just a few constant names but the vast majority of constants remained unchanged. I have manually checked the xml database file and all values were in there. If it had to do with handling the arguments incorrectly then the argument comments shouldn't be there I suppose.

If the arguments are annotated correctly it does not necessarily mean that the constants can be renamed successfully. Do you have a sample you can share?

I can share an xtremerat idb file which I downloaded from the Internet. Please let me know how to transfer it to you.

I can try to test it if you can provide a hash.

Here's the hash of the malicious file itself: 9E6B9D375DC5998E63F7376FEDF5CDF0

Thanks, what constants (offsets) are you expecting to be renamed?
One issue might be that functions are called via function thunks and not directly.


docs-bug(COMPONENT): TITLE

Documentation Feedback
Provide a brief summary of what you would like to see changed in our
documentation at material.angular.io.
Feel free to provide any suggestions of content or examples you’d like us to include.
Affected documentation page: Insert a link to the affected page on material.angular.io

Closing this issue as it does not follow the issue template. Please file a new issue that follows the template, which gives the team the information needed to investigate.


incorrect app.flags.DEFINE_boolean behavior

demo python script
test.py
#!/usr/bin/python
import tensorflow as tf
tf.app.flags.DEFINE_boolean('tea',False,'Soggy Leaves')
cfg = tf.app.flags.FLAGS

if cfg.tea:
    print( "have some tea" )
else:
    print( "no tea" )

Expected behavior
When the above test.py is run with any of {(no arguments), --notea, or --tea=True}, the script behaves as expected...
[markb@schur tmp]$ ./test.py
no tea
[markb@schur tmp]$ ./test.py --notea
no tea
[markb@schur tmp]$ ./test.py --tea=True
have some tea

Weird stuff
Strangely --tea=False is incorrectly interpreted as True.  Having both tea and no tea is only possible in certain Infocom games.
[markb@schur tmp]$ ./test.py --tea=False
have some tea

Apparently, only those who truly want tea will get it.
[markb@schur tmp]$ ./test.py --tea
usage: test.py [-h] [--tea TEA] [--notea]
test.py: error: argument --tea: expected one argument

C'mon. It's a boolean flag !
"Say something once.  Why say it again?"  -- Talking Heads

Looks like we're getting hit by: http://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse
It's doing bool("False") --> True.
I'll try to get it to support:
--tea  --> tea is True
--tea=True -> tea is True
--tea=False -> tea is False
--notea --> tea is False

@vrv
this issue still persists as of TF 1.12.0
All the examples above work as expected
but  ./test.py --tea False fails. Is this still expected behavior?

Thanks, I will raise it there

I know this has been closed for a long time and tf.app.flags are not really supported.


Allow More Custom Tags

Looking through the code I noticed that you have limited custom tags in b6868b1323258d07e501082d90620b98b80c121e
I ran into this as I was trying to add some custom tags to some of my custom metrics. I was wondering if you could shed any light on the context behind that change?
I was thinking about doing one of the following...

Updating docs to reflect that
Remove the constraint entirely
Enable setting allowed custom tags via environment variable

Before I made a PR, I wanted to understand why you made that change in the first place.

Yes they are limited because datadog does not handle very well if you have loads of them. This list should actually be configurable but apparently this has never happened. I this having the list defined by environment variable is a good approach so if you have a PR ready then please go ahead.

Not quite ready but should be able to create one soon. Thanks!


how to install shadcn ui without overriding my whole app in next js?

I want to install Shadcn UI on my Next.js project, but it is overriding my entire application. I only need it for a specific route, and I don't want it to override my other routes.

It only overrides globals.css file and tailwindconfig.js file.
To solve this issue there are 2 ways -

Install shadcn immediately after creating your project. (recommended)
While installing shadcn, copy code of globals.css and tailwindconfig.js and keep it somewhere else like in notepad. Then after installation of shadcn, paste it in your code again.

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.


Test Suite

[x] create schema online
[x] CRUD testing
[x] relational query
[x] other advanced queries (GROUP BY, etc)
[x] sequential operations (read, insert / update, read again and update again)
[x] Refactor the test suite such that it can generalizes over Postgres and MySQL (if possible, partially to SQLite)

Ideally the test suite should:

cover every SeaORM API
multiple cases for each API (has result, no result etc)
use more data types (UUID, Decimal, JSON, DateTime, etc)
operations that are more complex and 'real world application'
runs on SQLite, MySQL & Postgres

Thank you so much for the great work indeed!


Path subcommand

Description
A command like fgh path repo_name could be used in conjunction with cd like so:
cd `fgh p Matt-Gleich/fgh`

Good idea!

Ooh, then people could set up a bash alias to make ghcd repo work

We could have it so the root command just does cd

I have to figure out how to do parent process path exchanges tho

Sub-processes can't run cd at the shell level, though :cry:

How does ranger do it?

Good question :thinking:

We need the thonk emoji in GitHub issues

YES GITHUB NEEDS CUSTOM EMOJIS lol

lol


feat: Allow specification of pod annotations and labels

...via new object fields spec.deployment.metadata.annotations
and spec.deployment.metadata.labels.
Signed-off-by: Andrew Borley<EMAIL_ADDRESS>

LGTM , this only adds the labels to the pods , not to the deployment. But I think that's fine, that was what was requested originally :)


Manager button feedback

I want to add some feedback to the manager button.
Reason by example:

Open an issue or PR which has comments greater than view size.
Scroll to top
Close the issue/PR

Did it get closed?
It did, but there’s really no way of you knowing unless you scroll down and see the new cell added that says closed.
Same goes for reopen, lock...etc
Options:

Some banner appears indicating you closed/etc the issue/PR
Auto-scroll to bottom after data updates
Someone else has an idea

Thoughts? Ideas?
Sent with GitHawk

Auto scroll seems like the simplest. Agree with this!
Sent with GitHawk

Cool! I’ll take this one then! Thanks for the feedback
Sent with GitHawk

Taking this one, now I want this feature
Sent with GitHawk

Sorry 😔I’ve been swamped at school. Thanks for taking care of it.
Sent with GitHawk


Tiny: Move DbContextOptions to root namespace

Since it will now be referenced very commonly by applications.

:shipit:

Merged


Experimental Component - Breadcrumb - Design

Design
Create final design specifications that are ready for production. Functionality and variations should match as is Carbon components.

[ ] confirm Security design matches duo intent
[ ] confirm Sketch file sizing/spacing specs
[ ] screen grab sizing guidance and add to GitHub issue

Breadcrumb.zip


missing step

Missing the step that shows under Additional Settings, under "Use existing data", choose "Sample" so that AdventureWorksDW will be created as the sample database.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 90467e66-9062-01e3-6d40-fce8625d005b
Version Independent ID: 8db6b4e9-fd3a-8b45-1283-7f7144772a88
Content: Create and query a Synapse SQL pool (Azure portal) - Azure Synapse Analytics
Content Source: articles/synapse-analytics/sql-data-warehouse/create-data-warehouse-portal.md
Service: synapse-analytics
Sub-service: ****
GitHub Login: @kevinvngo
Microsoft Alias: Kevin

@jamserra  Thanks for bringing this to our attention. Your feedback  has been shared with the content owner for further review.
@kevinvngo Could you please add the missing steps in the article?

@jamserra Thank you for bringing this to our attention. I will work to resolve this.
@CHEEKATLAPRADEEP please assign this to me.

@jamserra Hello, I have added the addition screenshot to showcase how to create a SQL pool with sample data. It will be visible in the document soon. I will go ahead and close this issue. The @notification mechanism continues to work even after an item is closed, in case further communication is needed. We hope to hear from you again.

#please-close


db-postgres and nested-docs-plugin can lead to deadlocks generating the breadcrumb

Link to reproduction
No response
Payload Version
3.0.0-beta.78
Node Version
20 LTS
Next.js Version
15.104
Describe the Bug
In our production logs we have some entries of deadlocks. I'm unsure when this happens or how this can happen but perhaps anyone has an idea?
Server logs:
[14:53:04] ERROR: There was an error while saving a version for the Page with ID 3.
[14:53:04] ERROR: deadlock detected
    err: {
      "type": "DatabaseError",
      "message": "deadlock detected",
      "stack":
          error: deadlock detected
              at /app/node_modules/pg/lib/client.js:526:17
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at <anonymous> (webpack://babu-cms/node_modules/@payloadcms/db-postgres/node_modules/drizzle-orm/node-postgres/session.js:47:1)
              at Object.oE (webpack://babu-cms/node_modules/@payloadcms/db-postgres/dist/insert.js:7:1)
              at tE (webpack://babu-cms/node_modules/@payloadcms/drizzle/dist/upsertRow/insertArrays.js:41:1)
              at tk (webpack://babu-cms/node_modules/@payloadcms/drizzle/dist/upsertRow/index.js:271:1)
              at Object.iu (webpack://babu-cms/node_modules/@payloadcms/drizzle/dist/updateVersion.js:22:1)
              at l (webpack://babu-cms/node_modules/payload/dist/versions/saveVersion.js:53:1)
              at P (webpack://babu-cms/node_modules/payload/dist/collections/operations/updateByID.js:221:1)
              at Object.tW (webpack://babu-cms/node_modules/@payloadcms/next/dist/routes/rest/collections/updateByID.js:16:1)
      "length": 445,
      "name": "error",
      "severity": "ERROR",
      "code": "40P01",
      "detail": "Process 2526203 waits for ShareLock on transaction 27702; blocked by process 2526153.\nProcess 2526153 waits for ShareLock on transaction 27703; blocked by process 2526203.",
      "hint": "See server log for query details.",
      "where": "while locking tuple (0,52) in relation \"pages\"\nSQL statement \"SELECT 1 FROM ONLY \"public\".\"pages\" x WHERE \"id\" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x\"",
      "file": "deadlock.c",
      "line": "1130",
      "routine": "DeadLockReport"
    }
[14:53:04] ERROR: TypeError: Cannot read properties of undefined (reading 'title')
    at promise (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/promise.js:23:73)
    at <anonymous> (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/traverseFields.js:4:28)
    at Array.forEach (<anonymous>)
    at traverseFields (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/traverseFields.js:3:1)
    at promise (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/promise.js:413:17)
    at <anonymous> (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/traverseFields.js:4:28)
    at Array.forEach (<anonymous>)
    at traverseFields (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/traverseFields.js:3:1)
    at promise (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/promise.js:441:17)
    at <anonymous> (webpack://babu-cms/node_modules/payload/dist/fields/hooks/afterRead/traverseFields.js:4:28)

Postgres logs:
2024-08-20 16:24:04.245 CEST [2815046] sa-cms-db@cms ERROR:  deadlock detected
2024-08-20 16:24:04.245 CEST [2815046] sa-cms-db@cms DETAIL:  Process 2815046 waits for ShareLock on transaction 31221; blocked by process 2815251.
	Process 2815251 waits for ShareLock on transaction 31222; blocked by process 2815046.
	Process 2815046: insert into "_pages_v_version_breadcrumbs" ("_order", "_parent_id", "_locale", "id", "doc_id", "url", "label", "_uuid") values ($1, $2, $3, default, $4, $5, $6, $7), ($8, $9, $10, default, $11, $12, $13, $14), ($15, $16, $17, default, $18, $19, $20, $21), ($22, $23, $24, default, $25, $26, $27, $28) returning "_order", "_parent_id", "_locale", "id", "doc_id", "url", "label", "_uuid"
	Process 2815251:
	      UPDATE "_pages_v"
	      SET latest = false
	      WHERE "_pages_v"."id" != $1
	        AND "_pages_v"."parent_id" = $2

2024-08-20 16:24:04.245 CEST [2815046] sa-cms-db@cms HINT:  See server log for query details.
2024-08-20 16:24:04.245 CEST [2815046] sa-cms-db@cms CONTEXT:  while locking tuple (0,19) in relation "pages"
	SQL statement "SELECT 1 FROM ONLY "public"."pages" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x"
2024-08-20 16:24:04.245 CEST [2815046] sa-cms-db@cms STATEMENT:  insert into "_pages_v_version_breadcrumbs" ("_order", "_parent_id", "_locale", "id", "doc_id", "url", "label", "_uuid") values ($1, $2, $3, default, $4, $5, $6, $7), ($8, $9, $10, default, $11, $12, $13, $14), ($15, $16, $17, default, $18, $19, $20, $21), ($22, $23, $24, default, $25, $26, $27, $28) returning "_order", "_parent_id", "_locale", "id", "doc_id", "url", "label", "_uuid"

From postgres logs it seems to be related to versions, drafts and the nested_docs plugin with it's breadcrumb field.
Reproduction Steps
Currently unsure.
Adapters and Plugins
db-postgres

I started having the same issue in my dev encironment as well. It happens sporadically and I'm not sure how to replicate it.
Payload Version
2.0.0
Node Version
21.6.1
Next.js Version
13.5.2
Server logs
ozan@Ozans-Air ecommerce % yarn dev
yarn run v1.22.19
$ cross-env PAYLOAD_CONFIG_PATH=src/payload/payload.config.ts nodemon
[nodemon] 2.0.22
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): server.ts
[nodemon] watching extensions: js,ts
[nodemon] starting ts-node --project tsconfig.server.json src/server.ts -- -I
(node:71462) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
unhandledRejection error: deadlock detected
at /Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/pg-pool/index.js:45:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async DrizzleORMPgClient.query (/Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/drizzle-kit/payload.js:34498:21)
at async apply (/Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/drizzle-kit/payload.js:36648:9)
at async Object.connect (/Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/@payloadcms/db-postgres/src/connect.ts:124:3)
at async BasePayload.init (/Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/payload/src/payload.ts:372:7)
at async getPayload (/Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/payload/src/payload.ts:443:22)
at async initHTTP (/Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/payload/src/initHTTP.ts:33:19)
at async Payload.init (/Users/ozan/Desktop/Desktop/code/techfi/ecommerce/node_modules/payload/src/index.ts:17:21) {
length: 321,
severity: 'ERROR',
code: '40P01',
detail: 'Process 5336 waits for AccessExclusiveLock on relation 16743 of database 16384; blocked by process 5351.\n' +
'Process 5351 waits for AccessShareLock on relation 18989 of database 16384; blocked by process 5336.',
hint: 'See server log for query details.',
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'deadlock.c',
line: '1130',
routine: 'DeadLockReport'
}
[nodemon] app crashed - waiting for file changes before starting...
Postgres Logs
Process 5348: select "pages"."id", "pages"."title", "pages"."published_on", "pages"."hero_type", "pages"."hero_rich_text", "pages"."slug", "pages"."meta_title", "pages"."meta_description", "pages"."updated_at", "pages"."created_at", "pages"."_status", "pages__rels"."data" as "_rels", "pages_hero_links"."data" as "hero_links", "pages__blocks_cta"."data" as "_blocks_cta", "pages__blocks_content"."data" as "_blocks_content", "pages__blocks_mediaBlock"."data" as "_blocks_mediaBlock", "pages__blocks_archive"."data" as "_blocks_archive" from "pages" left join lateral (select coalesce(json_agg(json_build_array("pages__rels"."order", "pages__rels"."path", "pages__rels"."pages_id", "pages__rels"."media_id", "pages__rels"."categories_id", "pages__rels"."products_id") order by "pages__rels"."order" asc), '[]'::json) as "data" from (select * from "pages_rels" "pages__rels" where "pages__rels"."parent_id" = "pages"."id" order by "pages__rels"."order" asc) "pages__rels") "pages__rels" on true left join lateral (select coalesce(json_agg

Process 5336: ALTER TABLE "pages_hero_links" DROP CONSTRAINT "pages_hero_links_parent_id_fk";

2024-08-28 02:10:18.595 UTC [5348] HINT:  See server log for query details.
2024-08-28 02:10:18.595 UTC [5348] STATEMENT:  select "pages"."id", "pages"."title", "pages"."published_on", "pages"."hero_type", "pages"."hero_rich_text", "pages"."slug", "pages"."meta_title", "pages"."meta_description", "pages"."updated_at", "pages"."created_at", "pages"."_status", "pages__rels"."data" as "_rels", "pages_hero_links"."data" as "hero_links", "pages__blocks_cta"."data" as "_blocks_cta", "pages__blocks_content"."data" as "_blocks_content", "pages__blocks_mediaBlock"."data" as "_blocks_mediaBlock", "pages__blocks_archive"."data" as "_blocks_archive" from "pages" left join lateral (select coalesce(json_agg(json_build_array("pages__rels"."order", "pages__rels"."path", "pages__rels"."pages_id", "pages__rels"."media_id", "pages__rels"."categories_id", "pages__rels"."products_id") order by "pages__rels"."order" asc), '[]'::json) as "data" from (select * from "pages_rels" "pages__rels" where "pages__rels"."parent_id" = "pages"."id" order by "pages__rels"."order" asc) "pages__rels") "pages__rels" on true left join lateral (select coalesce(json_agg(json_build_array("pages_hero_links"."_order", "pages_hero_links"."id", "pages_hero_links"."link_type", "pages_hero_links"."link_new_tab", "pages_hero_links"."link_url", "pages_hero_links"."link_label", "pages_hero_links"."link_appearance") order by "pages_hero_links"."_order" asc), '[]'::json) as "data" from (select * from "pages_hero_links" where "pages_hero_links"."_parent_id" = "pages"."id" order by "pages_hero_links"."_order" asc) "pages_hero_links") "pages_hero_links" on true left join lateral (select coalesce(json_agg(json_build_array("pages__blocks_cta"."_order", "pages__blocks_cta"."_path", "pages__blocks_cta"."id", "pages__blocks_cta"."invert_background", "pages__blocks_cta"."rich_text", "pages__blocks_cta"."block_name", "pages__blocks_cta_links"."data") order by "pages__blocks_cta"."_order" asc), '[]'::json) as "data" from (select * from "pages_blocks_cta" "pages__blocks_cta" where "pages__blocks_cta"."_parent_id" = "pages"."id" order by "pages__blocks_cta"."_order" asc) "pages__blocks_cta" left join lateral (select coalesce(json_agg(json_build_array("pages__blocks_cta_links"."_order", "pages__blocks_cta_links"."id", "pages__blocks_cta_links"."link_type", "pages__blocks_cta_links"."link_new_tab", "pages__blocks_cta_links"."link_url", "pages__blocks_cta_links"."link_label", "pages__blocks_cta_links"."link_appearance") order by "pages__blocks_cta_links"."_order" asc), '[]'::json) as "data" from (select * from "pages_blocks_cta_links" "pages__blocks_cta_links" where "pages__blocks_cta_links"."_parent_id" = "pages__blocks_cta"."id" order by "pages__blocks_cta_links"."_order" asc) "pages__blocks_cta_links") "pages__blocks_cta_links" on true) "pages__blocks_cta" on true left join lateral (select coalesce(json_agg(json_build_array("pages__blocks_content"."_order", "pages__blocks_content"."_path", "pages__blocks_content"."id", "pages__blocks_content"."invert_background", "pages__blocks_content"."block_name", "pages__blocks_content_columns"."data") order by "pages__blocks_content"."_order" asc), '[]'::json) as "data" from (select * from "pages_blocks_content" "pages__blocks_content" where "pages__blocks_content"."_parent_id" = "pages"."id" order by "pages__blocks_content"."_order" asc) "pages__blocks_content" left join lateral (select coalesce(json_agg(json_build_array("pages__blocks_content_columns"."_order", "pages__blocks_content_columns"."id", "pages__blocks_content_columns"."size", "pages__blocks_content_columns"."rich_text", "pages__blocks_content_columns"."enable_link", "pages__blocks_content_columns"."link_type", "pages__blocks_content_columns"."link_new_tab", "pages__blocks_content_columns"."link_url", "pages__blocks_content_columns"."link_label", "pages__blocks_content_columns"."link_appearance") order by "pages__blocks_content_columns"."_order" asc), '[]'::json) as "data" from (select * from "pages_blocks_content_columns" "pages__blocks_content_columns" where "pages__blocks_content_columns"."_parent_id" = "pages__blocks_content"."id" order by "pages__blocks_content_columns"."_order" asc) "pages__blocks_content_columns") "pages__blocks_content_columns" on true) "pages__blocks_content" on true left join lateral (select coalesce(json_agg(json_build_array("pages__blocks_mediaBlock"."_order", "pages__blocks_mediaBlock"."_path", "pages__blocks_mediaBlock"."id", "pages__blocks_mediaBlock"."invert_background", "pages__blocks_mediaBlock"."position", "pages__blocks_mediaBlock"."block_name") order by "pages__blocks_mediaBlock"."_order" asc), '[]'::json) as "data" from (select * from "pages_blocks_media_block" "pages__blocks_mediaBlock" where "pages__blocks_mediaBlock"."_parent_id" = "pages"."id" order by "pages__blocks_mediaBlock"."_order" asc) "pages__blocks_mediaBlock") "pages__blocks_mediaBlock" on true left join lateral (select coalesce(json_agg(json_build_array("pages__blocks_archive"."_order", "pages__blocks_archive"."_path", "pages__blocks_archive"."id", "pages__blocks_archive"."intro_content", "pages__blocks_archive"."populateBy", "pages__blocks_archive"."relationTo", "pages__blocks_archive"."limit", "pages__blocks_archive"."populated_docs_total", "pages__blocks_archive"."block_name") order by "pages__blocks_archive"."_order" asc), '[]'::json) as "data" from (select * from "pages_blocks_archive" "pages__blocks_archive" where "pages__blocks_archive"."_parent_id" = "pages"."id" order by "pages__blocks_archive"."_order" asc) "pages__blocks_archive") "pages__blocks_archive" on true where ("pages"."id" in ($1) and "pages"."_status" = $2) order by "pages"."created_at" desc
2024-08-28 02:10:18.600 UTC [5336] ERROR:  deadlock detected
2024-08-28 02:10:18.600 UTC [5336] DETAIL:  Process 5336 waits for AccessExclusiveLock on relation 16743 of database 16384; blocked by process 5351.
Process 5351 waits for AccessShareLock on relation 18989 of database 16384; blocked by process 5336.

Process 5336: ALTER TABLE "pages_hero_links" DROP CONSTRAINT "pages_hero_links_parent_id_fk";

Process 5351: select "pages"."id", "pages"."title", "pages"."published_on", "pages"."hero_type", "pages"."hero_rich_text", "pages"."slug", "pages"."meta_title", "pages"."meta_description", "pages"."updated_at", "pages"."created_at", "pages"."_status", "pages__rels"."data" as "_rels", "pages_hero_links"."data" as "hero_links", "pages__blocks_cta"."data" as "_blocks_cta", "pages__blocks_content"."data" as "_blocks_content", "pages__blocks_mediaBlock"."data" as "_blocks_mediaBlock", "pages__blocks_archive"."data" as "_blocks_archive" from "pages" left join lateral (select coalesce(json_agg(json_build_array("pages__rels"."order", "pages__rels"."path", "pages__rels"."pages_id", "pages__rels"."media_id", "pages__rels"."categories_id", "pages__rels"."products_id") order by "pages__rels"."order" asc), '[]'::json) as "data" from (select * from "pages_rels" "pages__rels" where "pages__rels"."parent_id" = "pages"."id" order by "pages__rels"."order" asc) "pages__rels") "pages__rels" on true left join lateral (select coalesce(json_agg

2024-08-28 02:10:18.600 UTC [5336] HINT:  See server log for query details.
2024-08-28 02:10:18.600 UTC [5336] STATEMENT:  ALTER TABLE "pages_hero_links" DROP CONSTRAINT "pages_hero_links_parent_id_fk";
2024-08-28 02:13:41.288 UTC [26] LOG:  checkpoint starting: tim


x:Bind doesn't work for classes with no namespace

Describe the bug

Currently it is possible to use x:Bind to bind either to instance properties/functions (which the codegen will lookup from the code behind), or to static function or properties. For instance:
<TextBlock
    xmlns:system="using:System"
    Text="{x:Bind system:DateTime.Now.ToShortDateString()}"/>

The issue is that there isn't a way (or at least, I haven't been able to figure this out and couldn't find any docs about this) to bind to a static target from a class with no namespace. I realize this is not very common, but for instance in my app I'm using the GitInfo library, which adds a static ThisAssembly class which you can use to retrieve info on your git repository (eg. to display the git branch/commit in your app). The generated class has no namespace, and from what I can see there's no way to use it directly from XAML. This is the code I'm currently using to work around this issue:
public string GitBranch => ThisAssembly.Git.Branch;

<TextBlock Text="{x:Bind ViewModel.GitBranch}"/>

There should also be a way to use x:Bind to targets that are in no particular namespace, just like it is possible to do so for the others. For instance, something like:
<TextBlock
    xmlns:global="using"
    Text="{x:Bind global:ThisAssembly.Git.Branch}"/>

The syntax above was proposed by @chingucoding - really I'd be ok with anything. I should add that not using a prefix in the x:Bind path doesn't work either, as the XAML compiler would then just go look for a ThisAssembly property in code behind, fail to find it and then throw a build error.
Steps to reproduce the bug

Install GitInfo
Try to just use XAML to display ThisAssembly.Git.Branch through x:Bind

Expected behavior

The fact that a class might not have a namespace shouldn't prevent it from being used with x:Bind
Version Info

Windows 10 version
Saw the problem?

Insider Build (xxxxx)

November 2019 Update (18363)
Yes

May 2019 Update (18362)

October 2018 Update (17763)

April 2018 Update (17134)

Fall Creators Update (16299)

Creators Update (15063)

Device form factor
Saw the problem?

Desktop
Yes

Mobile

Xbox

Surface Hub

IoT

Bumping this (see https://github.com/microsoft/microsoft-ui-xaml/discussions/8638).


Placeholders %pagenumber% and %pagecount% not working

The %pagenumber% and %pagecount% placeholders do not appear to be working.  They both continuously generate the value 1, regardless of what page contains the object using the placeholder.
Start a new document, then enable page separators (View > Page View).
Place a text object on the visible page and fill it with the contents %pagecount%.  Right-click and choose the Edit Data option, then enable the Placeholders option.  With the Placeholders option enabled, the text object (when not editing the contents) should show the number 1.
Add a second text object and drag it across the edge of the page to cause a second page to be created.  Configure the second text object in the same way (contents %pagecount%, Placeholder enabled).  The number 1 appears on the second text object, as well.
Print the document - the number 1 on both pages.
I'm using the online tool at diagrams.net, currently 13.8.6.

Please could you close all diagrams.net tabs, load https://app.diagrams.net/?offline=0 to clear your cache, close that tab and open a new one. That should update you to a more recent version. Does the problem still happen?

Hello David.
With the cache cleared, I now see version 14.1.1, but the behavior is still the same.  Below is the complete XML from the Extras > Edit Diagram menu.
Note that including headers/footers shows the correct page number and number of pages (1/2 and 2/2), while %pagenumber% and %pagecount% are still both 1 for all pages on the same document.
Are you able to use these placeholders successfully using the web-based app at diagrams.net?
<mxGraphModel dx="1408" dy="780" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0" extFonts="Permanent Marker^https://fonts.googleapis.com/css?family=Permanent+Marker">   <root>     <mxCell id="0" />     <mxCell id="1" parent="0" />     <object label="Page %pagenumber% of %pagecount%" placeholders="1" id="rcTtCaBVkUmVItbQ2x3F-1">       <mxCell style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">         <mxGeometry x="405" y="340" width="295" height="20" as="geometry" />       </mxCell>     </object>     <object label="Page %pagenumber% of %pagecount%
" placeholders="1" id="rcTtCaBVkUmVItbQ2x3F-2">       <mxCell style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">         <mxGeometry x="1080" y="340" width="270" height="20" as="geometry" />       </mxCell>     </object>   </root> </mxGraphModel>


TypeError: get_default_optimizer_params() got an unexpected keyword argument 'lr_factor_func'

Traceback (most recent call last):
File "train_multidatasets.py", line 573, in
launch(
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/detectron2/engine/launch.py", line 67, in launch
mp.spawn(
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 230, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
while not context.join():
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 150, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:
-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
fn(i, *args)
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/detectron2/engine/launch.py", line 126, in _distributed_worker
main_func(*args)
File "/home/user/morjio/projects/detection/ZiRaGroundingDINO/train_multidatasets.py", line 493, in main
do_train(args, cfg)
File "/home/user/morjio/projects/detection/ZiRaGroundingDINO/train_multidatasets.py", line 398, in do_train
optim = instantiate(cfg.optimizer)
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/detectron2/config/instantiate.py", line 61, in instantiate
cfg = {k: instantiate(v) for k, v in cfg.items()}
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/detectron2/config/instantiate.py", line 61, in
cfg = {k: instantiate(v) for k, v in cfg.items()}
File "/home/user/anaconda3/envs/zira_py3.8/lib/python3.8/site-packages/detectron2/config/instantiate.py", line 77, in instantiate
return cls(**cfg)
TypeError: get_default_optimizer_params() got an unexpected keyword argument 'lr_factor_func'

I just tried my code and found nothing wrong. It may be an issue of inconsistent dependency versions. What is the version of your Detectron2.

Thank you for your reply. According to the requirements in requirements.txt, the Detectron2 version is 0.6. Could you please show the versions of all your Python libraries (such as the torch version, etc.)? Thank you very much.

Additionally, could you also mention the version of Python you are using? Although this isn't very important, it may affect the versions of the Python packages you install.

Thank you for your suggestion. We has show all the Python libraries in requirements.txt, and provide recommendation using Python 3.9 in readme.


[Bug]: Empty bookmark icon is not adaptive to theme changes

Is there an existing issue for this?

[X] I have searched the existing issues

Is there a StackOverflow question about this issue?

[X] I have searched StackOverflow

What happened?
Currently the bookmark icon color is showing the purple default icon and doesn't change with the theme color/gradient

Relevant logcat output
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct

Other icon gradient issue is handled in https://github.com/android/nowinandroid/issues/506 . Separating this as the original issue got too big


[BUG] Movielens 02 ETL error with CPU

When running Notebook: https://github.com/NVIDIA/NVTabular/blob/main/examples/getting-started-movielens/02-ETL-with-NVTabular.ipynb there is an error in Categorify related to: https://github.com/NVIDIA/NVTabular/blob/main/nvtabular/ops/categorify.py#L829
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<timed eval> in <module>

/NVTA/nvtabular/workflow.py in fit(self, dataset)
    150                 results = [r.result() for r in self.client.compute(stats)]
    151             else:
--> 152                 results = dask.compute(stats, scheduler="synchronous")[0]
    153
    154             for computed_stats, op in zip(results, ops):

/usr/local/lib/python3.8/dist-packages/dask/base.py in compute(*args, **kwargs)
    565         postcomputes.append(x.__dask_postcompute__())
    566
--> 567     results = schedule(dsk, keys, **kwargs)
    568     return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
    569

/usr/local/lib/python3.8/dist-packages/dask/local.py in get_sync(dsk, keys, **kwargs)
    558     """
    559     kwargs.pop("num_workers", None)  # if num_workers present, remove it
--> 560     return get_async(
    561         synchronous_executor.submit,
    562         synchronous_executor._max_workers,

/usr/local/lib/python3.8/dist-packages/dask/local.py in get_async(submit, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, chunksize, **kwargs)
    501             while state["waiting"] or state["ready"] or state["running"]:
    502                 fire_tasks(chunksize)
--> 503                 for key, res_info, failed in queue_get(queue).result():
    504                     if failed:
    505                         exc, tb = loads(res_info)

/usr/lib/python3.8/concurrent/futures/_base.py in result(self, timeout)
    430                 raise CancelledError()
    431             elif self._state == FINISHED:
--> 432                 return self.__get_result()
    433
    434             self._condition.wait(timeout)

/usr/lib/python3.8/concurrent/futures/_base.py in __get_result(self)
    386     def __get_result(self):
    387         if self._exception:
--> 388             raise self._exception
    389         else:
    390             return self._result

/usr/local/lib/python3.8/dist-packages/dask/local.py in submit(self, fn, *args, **kwargs)
    543         fut = Future()
    544         try:
--> 545             fut.set_result(fn(*args, **kwargs))
    546         except BaseException as e:
    547             fut.set_exception(e)

/usr/local/lib/python3.8/dist-packages/dask/local.py in batch_execute_tasks(it)
    235     Batch computing of multiple tasks with `execute_task`
    236     """
--> 237     return [execute_task(*a) for a in it]
    238
    239

/usr/local/lib/python3.8/dist-packages/dask/local.py in <listcomp>(.0)
    235     Batch computing of multiple tasks with `execute_task`
    236     """
--> 237     return [execute_task(*a) for a in it]
    238
    239

/usr/local/lib/python3.8/dist-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
    226         failed = False
    227     except BaseException as e:
--> 228         result = pack_exception(e, dumps)
    229         failed = True
    230     return key, result, failed

/usr/local/lib/python3.8/dist-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
    221     try:
    222         task, data = loads(task_info)
--> 223         result = _execute_task(task, data)
    224         id = get_id()
    225         result = dumps((result, id))

/usr/local/lib/python3.8/dist-packages/dask/core.py in _execute_task(arg, cache, dsk)
    119         # temporaries by their reference count and can execute certain
    120         # operations in-place.
--> 121         return func(*(_execute_task(a, cache) for a in args))
    122     elif not ishashable(arg):
    123         return arg

/usr/lib/python3.8/contextlib.py in inner(*args, **kwds)
     73         def inner(*args, **kwds):
     74             with self._recreate_cm():
---> 75                 return func(*args, **kwds)
     76         return inner
     77

/NVTA/nvtabular/ops/categorify.py in _write_uniques(dfs, base_path, col_group, options)
    827                 nulls_missing = True
    828                 new_cols[col] = _concat(
--> 829                     [df._constructor_sliced([None], dtype=df[col].dtype), df[col]],
    830                     ignore_index=True,
    831                 )

/usr/local/lib/python3.8/dist-packages/pandas/core/series.py in __init__(self, data, index, dtype, name, copy, fastpath)
    325                     data = data.copy()
    326             else:
--> 327                 data = sanitize_array(data, index, dtype, copy, raise_cast_failure=True)
    328
    329                 data = SingleBlockManager.from_array(data, index)

/usr/local/lib/python3.8/dist-packages/pandas/core/construction.py in sanitize_array(data, index, dtype, copy, raise_cast_failure)
    445
    446         if dtype is not None:
--> 447             subarr = _try_cast(data, dtype, copy, raise_cast_failure)
    448         else:
    449             subarr = maybe_convert_platform(data)

/usr/local/lib/python3.8/dist-packages/pandas/core/construction.py in _try_cast(arr, dtype, copy, raise_cast_failure)
    553         if is_integer_dtype(dtype):
    554             # this will raise if we have e.g. floats
--> 555             maybe_cast_to_integer_array(arr, dtype)
    556             subarr = arr
    557         else:

/usr/local/lib/python3.8/dist-packages/pandas/core/dtypes/cast.py in maybe_cast_to_integer_array(arr, dtype, copy)
   1672     try:
   1673         if not hasattr(arr, "astype"):
-> 1674             casted = np.array(arr, dtype=dtype, copy=copy)
   1675         else:
   1676             casted = arr.astype(dtype, copy=copy)

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

any ideas @benfred @rjzamora ?

@jperez999 were you looking into anything similar?

Can you verify the version of dask you're running? We need to be using 2022.4.1 here - we've seen this issue with newer versions of dask

Solved with our latests container using dask and dsitributed 2021.04.1

Still getting errors with latest containers

It seems this problem is related to nullabe-integer types in Pandas.  Since cudf allows null values in its "int32"/"int64" columns, there are many places in NVTabular where we require/expect the data to be casted to these types.  More-recent version of Pandas seem to throw errors when you try to create an "int32"/"int64" Series/column when null values are present.


[WIP] Fixing Minor Issues

@EverLookNeverSee  Can you please address PyLint errors? Thanks!

@EverLookNeverSee Can you please address PyLint errors? Thanks!

It is written in tensorflow code style that the indentation size should be multiply four, but pylint says the indentation should be 6 instead of 12 in some lines.

I am going to ignore fixing the line indentations.

I decided to close this PR and create a new one without manipulating the line indentations.


reduce_window broken on CPU

Description
import jax
import jax.numpy as jnp

jax.lax.reduce_window(
    jnp.ones((1, 48, 48, 15), dtype=jnp.float32),
    0.,
    jax.lax.add,
    (1, 6, 6, 1),
    (1, 6, 6, 1),
    window_dilation=(1, 1, 1, 1),
    padding='VALID')

Produces
TypeError: reduce_window window_dimensions must have every element be an integer type, got (<class 'int'>, <class 'float'>, <class 'float'>, <class 'int'>).

System info (python version, jaxlib version, accelerator, etc.)
jax:    0.4.29
jaxlib: 0.4.29
numpy:  1.26.3
python: 3.11.8 (stable, redacted, redacted)
jax.devices (1 total, 1 local): [CpuDevice(id=0)]
process_count: 1

I'm unable to reproduce this on my machine.
You report JAX v0.4.29, which is not yet released. Are you running from an updated main branch?
Also, since jaxlib 0.4.29 doesn't exist yet, are you using a nightly build?
Thanks!

We determined offline that this issue does not reproduce at HEAD, but only at some intermediate commit from last week. I won't debug further unless this shows up again


ES6 doesn't work on react-native

I was wondering how did you get
import Button from 'apsl-react-native-button'; to work. I could only use es5 syntax of importing modules.

Hello @holyxiaoxin! what's your Babel config?

Try to use a .babelrc config:
{
  "whitelist": [
    "es6.modules"
  ]
}

Source: http://wiredify.com/shohey1226/logs/React-Native-with-bebelrc

I'm closing the issue, let me know if you need something @holyxiaoxin :)


Remove errno accesses from the OS

Propsition
Nothing inside of the OS should access the per-thread errno variable.  Why?

This is a improper separation of responsibilities.  errno is strictly a feature of the user-space via libs/libc.  The OS should perform basic operation, but user space operations under libs/libc should be the only place where the errno is maniuplated.

Linux and GLIBC have this same separation of functionality:  GLIBC manages the errno variable, not Linux

Modifying the errno is dangerous within the OS.  The errno is kept in TLS which resides on the thread's stack.  The OS internals, however, may operate on different kernel threads or even, as Linux does, perform all system calls on a different stack.  So, whenever a snippet of code within the OS modifies the errno, it is assuming implicitly that caller's stack is in effect.  But that might not always be the case.

In the KERNEL mode of operation, the user stack may not be accessible unless the correct address environment is instantiated, making modification of the user stack more complex, more risky.
So it would be a positive improvement to the OS if all errno operations were removed from the OS and, instead, performed in user space by logic in libs/libc
Front End Functions
Within the OS, special measures have been taken so that the OS does not modify the errno in most cases.  This is done with (1) a front end, user OS interfaces that modify the errno and (2) a separate internal version of the OS interface that does not modify the errno.  This latter interface is the one used exclusively within the OS.
The general pattern is like for the following for some_os_interface():
int some_os_interface(int some_parameters)
{
  int ret = nx_some_os_interface(some_parameters);
  if (ret < 0)
    {
      set_errno(-ret);
      ret = ERROR;
    }

  return ret;
}

Where nx_some_os_interface() is the internal implementation of the OS interface that does NOT set the errno variable.
This general pattern could be easily moved to user space in /libs/libc.  Only a few things would have to change:

The implementation of some_os_interface() would have to be separated and moved to a new file under /libs/libc.
In syscall/* and in include/sys/*, all references to some_os_interface() would have to be changed to nx_some_os_interface().

Easy, right?  Only two things make this difficult:  (1) there are many such tiny functions that would have to be changed, and (2) cancellation points make things more complex.
Cancellation Points
If some_os_interface() is a cancellation point, then there is more in the front end function.  Such a front end function would look more like:
int some_os_interface(int some_parameters)
{
  int ret;

  enter_cancellation_point();

  ret = nx_some_os_interface(some_parameters);
  if (ret < 0)
    {
      set_errno(-ret);
      ret = ERROR;
    }

  leave_cancellation_point();
  return ret;
}

And enter/leave_cancellation_point() are OS functions that cannot be called from user-space logic in libs/libc.  In this case, some_os_interface() would have to be separated into two functions:
int some_cancellable_os_interface(int some_parameters)
{
  int ret;

  enter_cancellation_point();

  ret = nx_some_os_interface(some_parameters);

  leave_cancellation_point();
  return ret;
}

And
int some_os_interface(int some_parameters)
{
  int ret;

  enter_cancellation_point();

  ret = some_cancellable_os_interface(some_parameters);
  if (ret < 0)
    {
      set_errno(-ret);
      ret = ERROR;
    }

  leave_cancellation_point();
  return ret;
}

The implementation of some_os_interface() would have to be separated into two functions and the one that modifies the errno would be moved to a new file under /libs/libc.
In syscall/* and in include/sys/*, all references to some_os_interface ()would have to be changed to some_cancelable_os_interface().

Signal Handlers
I have not done any detailed analysis, but the other place where there are many modifications to errno value is in implementations of the function up_sigdeliver().  In that function, it preserves the old errno value, calls the signal handler, then restores the old errno value.  This preserves the errno value so that it is not lost due to signal handling logic.
In this case, the signal handler should always be running on the same stack as the thread that it interrupted so errno access should be safe.
However, this logic could simply be removed:  It is not the responsibility of the OS signal handling logic to preserve the errno value; it is the responsibility of the signal handler to save and restore the errno value.  Per GLIBC documentation under "<IP_ADDRESS> POSIX Safety Concepts" (https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html):

"AS-Safe or Async-Signal-Safe functions are safe to call from asynchronous signal handlers. AS, in AS-Safe, stands for Asynchronous Signal.
"Many functions that are AS-Safe may set errno, or modify the floating-point environment, because their doing so does not make them unsuitable for use in signal handlers. However, programs could misbehave should asynchronous signal handlers modify this thread-local state, and the signal handling machinery cannot be counted on to preserve it. Therefore, signal handlers that call functions that may set errno or modify the floating-point environment must save their original values, and restore them before returning."

The general pattern is like for the following for some_os_interface():
int some_os_interface(int some_parameters)
{
  int ret = nx_some_os_interface(some_parameters);
  if (ret < 0)
    {
      set_errno(-ret);
      ret = ERROR;
    }

  return ret;
}

Why we can't extend mksyscall to insert set_errno inside PROXY_some_os_interface?

And enter/leave_cancellation_point() are OS functions that cannot be called from user-space logic in libs/libc. In this case, some_os_interface() would have to be separated into two functions:
int some_cancellable_os_interface(int some_parameters)
{
  int ret;

  enter_cancellation_point();

  ret = nx_some_os_interface(some_parameters);

  leave_cancellation_point();
  return ret;
}

And
int some_os_interface(int some_parameters)
{
  int ret;

  enter_cancellation_point();

  ret = some_cancellable_os_interface(some_parameters);
  if (ret < 0)
    {
      set_errno(-ret);
      ret = ERROR;
    }

  leave_cancellation_point();
  return ret;
}

Why we can't extend mksyscall to insert [enter|levea]_cancellation_point inside STUB_some_cancellable_os_interface?

The implementation of some_os_interface() would have to be separated into two functions and the one that modifies the errno would be moved to a new file under /libs/libc.
In syscall/* and in include/sys/*, all references to some_os_interface ()would have to be changed to some_cancelable_os_interface().

Signal Handlers
I have not done any detailed analysis, but the other place where there are many modifications to errno value is in implementations of the function up_sigdeliver(). In that function, it preserves the old errno value, calls the signal handler, then restores the old errno value. This preserves the errno value so that it is not lost due to signal handling logic.

We need consider another common case too:
Many function inside OS also call libc function which isn't implemented by kernel but alos modify errno. For example:
static int imxrt_rdtime(FAR struct rtc_lowerhalf_s *lower,
                        FAR struct rtc_time *rtctime)
{
  time_t timer;

  /* The resolution of time is only 1 second */

  timer = up_rtc_time();

  /* Convert the one second epoch time to a struct tm */

  if (gmtime_r(&timer, (FAR struct tm *)rtctime) == 0)
    {
      int errcode = get_errno();
      DEBUGASSERT(errcode > 0);

      rtcerr("ERROR: gmtime_r failed: %d\n", errcode);
      return -errcode;
    }

  return OK;
}

Those are VERY good ideas!  Thank you.  The is the perfect solution for PROTECTED and KERNEL builds.
FLAT would be a little additional work.  We would have to generate proxies and stubs in the FLAT configuration too.  There would be no software interrupt in that case, but a direct call from the proxy to the stub.  So they would not be the same proxies; they would not call the the syscall_callXX function.
The messy marshalling and type conversion would add a little overhead.  We would always have to insert the system call number even if it is not used, for example.  Perhaps the special FLAT version of the stubs and proxies would omit the syscall number from the parameter list.  Then the call to from the proxy to the stub could be well optimised.
Certainly worth some additional thought.

Yes, for FLAT build can pass a special flag to mksyscall, let PROXY_xxx call STUB_xxx directly without any syscall NR.

We can even have the same function name for both kernel and userspace(FLAT build need some clear method, but it's doable), then the wrong usage(e.g. call sem_post instead nxsem_post inside kernel) can be eliminated automatically.

I expect that this proposal assumes that POSIX APIs are a system calls, however such approach introduce the implicit cancellation point support. For example the some of libc rely on sem_wait and that makes the users of sem_wait to become a cancellation points implicitly. That is not good. We need to have a system call layer that is agnostic to cancellation points and does not use errno. There are not much of such cases, so maybe having two variants of semaphore system call APIs may be a solution (like nxsem_wait and nxsem_wait_cancellable()) or making one more generic system call API in the middle like nxsem_wait_proxy(FAR sem_t *sem, int oflags); where oflags will be CANCELABLE, BLOCK, etc., so nxsem_wait, nxsem_trywait, sem_wait and sem_trywait can be implemented calling a proxy. I'm not sure what is the best strategy.

For the most of the cases when API is not a cancellation point it is easy to make NX API as a system call and create a libc wrapper that will handle errno correctly. The real problem is cancellation point APIs (the APIs that pend). The cancellation point enter/leave should be executed n kernel mode, so I do not see any other option that creating a two variants of the same API that differ only with cancellation point management and expose both as system calls.
Again that contradicts assumption that only POSIX APIs are a system calls. Anyway we already have many NX APIs as system calls, so I think we can make whatever is convenient to be used.