Show notification status on home screen if off

Why: we would like to tell the user if their notifications are off.
This commit:
Adds a card to the home screen that informs the user if their
notifications are off. If the card is pressed and notification
permissions have not been previously denied, the app will request
notification permissions from the OS. If notifications have been
previously, the app will open the app settings.

@mattThousand Running into some funky behavior here. The notification status seems to start off as Denied, and to activate notifications, we need to request permissions. However, if the user previously had notifications on and then turned them off, requesting notifications permissions will do nothing. In that case, we need to send the user to the app settings to manually turn on notifications. However, I don't know how we can tell whether to to request notification permissions or send the user to app settings, because in either case the notification status is Denied. Thoughts?

@mattThousand Running into some funky behavior here. The notification status seems to start off as Denied, and to activate notifications, we need to request permissions. However, if the user previously had notifications on and then turned them off, requesting notification permissions will do nothing. In that case, we need to send the user to the app settings to manually turn on notifications. However, I don't know how we can tell on the JS side which route to take (request notification permissions or send the user to app settings) because in either case the notification status is Denied. Thoughts?

Check out the flow chart below, which describes how permissions behave on iOS - my reading is that you would get Denied both in the case in which a user has not requested notification permissions previously and in the case where they have, but they've also gone into settings and disabled notifications. Are you getting the same status in both cases?


Save test's and node's artifacts produced during test run

https://github.com/input-output-hk/cardano-node-tests/pull/105


Revert "Knshq reformatting 2"

Reverts Chameleon-company/Evoleon#41 as it breaks favourite system, established in the Evoleon application. This request bypassed the due process of being reviewed and merged by another student. Next time communicate with the team on changes, we would have been happy to advise in this regard.

Absolutely agree. This commit breaks more than it changes with the potential for further undiscovered bugs. It appears as though each commit was automated using GPT with no oversight since there are still glaring issues.


Automated Package Upgrade

:tada: This PR is included in version 2.2.470 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Add note about batching into README.md

This PR related to the issue #498.
I have used the documentation here to add a snippet of code in README.md that shows how we can use Batch to upload points more reliably.
All Submissions:

[x] Contributions should target the dev branch. Did you create your branch from dev?
[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Hey @geetu040
In #498 I described two approaches

when users try to upload points one-by-one
when users try to upload all the points in one request

This PR is a showcase for the latter approach
And we want users to either split data into batches on their own, or use methods like upload_collection or upload_points

fixed in #516


Update test data in response to #121

PR #121 changed pkg_deb's behavior but didn't update test data to match.
Reported in PR #132.
Testing Done:

bazelisk test ...

Oops, thanks for updating the test and apologies fir not doing it myself.  I have not been aware of the tests / haven't looked closely enough.
Andreas

Did anyone verify that the .deb is still instanable? It seems to me that
the path of config is changed to have a leading ./. That might not be
totally compatible, even if it appears to work.
On Sat, Feb 29, 2020, 6:59 AM andreas-0815-qwertz<EMAIL_ADDRESS>wrote:

Oops, thanks for updating the test and apologies fir not doing it myself.
I have not been aware of the tests / haven't looked closely enough.
Andreas
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
https://github.com/bazelbuild/rules_pkg/pull/137?email_source=notifications&email_token=AAXHHHCAXPEUJ5JYDDIFWJLRFD4ARA5CNFSM4K57WBY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENLYHUI#issuecomment-592937937,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAXHHHCJNHK7GOQL6RYIWRLRFD4ARANCNFSM4K57WBYQ
.

I did, using "opkg"; old versions only install, when content.tar.gz has leading "./" for its contained files, newer ones accept both forms.  Dpkg still prepends the "./": on my Debian testing system, the following bash command
for deb in /var/cache/apt/archives/*.deb ; do
ar -p $deb control.tar.xz | xz -dc | tar tvf -
done
for all archived packages from "deb.debian.org" results in
drwxr-xr-x root/root         0 2020-02-13 06:14 ./
-rw-r--r-- root/root       436 2020-02-13 06:14 ./control
-rw-r--r-- root/root       176 2020-02-13 06:14 ./md5sums
drwxr-xr-x root/root         0 2020-02-13 06:14 ./
-rw-r--r-- root/root       760 2020-02-13 06:14 ./control
-rw-r--r-- root/root<PHONE_NUMBER>-02-13 06:14 ./md5sums
-rwxr-xr-x root/root       542 2020-02-13 06:14 ./postinst
drwxr-xr-x root/root         0 2020-02-13 06:14 ./
-rw-r--r-- root/root       629 2020-02-13 06:14 ./control
-rw-r--r-- root/root<PHONE_NUMBER>-02-13 06:14 ./md5sums
drwxr-xr-x root/root         0 2020-02-13 06:14 ./
-rw-r--r-- root/root       473 2020-02-13 06:14 ./control
-rw-r--r-- root/root      5029 2020-02-13 06:14 ./md5sums
Thus, if the patch does not work, packages created by dpkg will neither.
Andreas

Cool. I.am ooo this week. Please ask another owner to merge.
On Sat, Feb 29, 2020, 11:56 AM andreas-0815-qwertz<EMAIL_ADDRESS>wrote:

I did, using "opkg"; old versions only install, when content.tar.gz has
leading "./" for its contained files, newer ones accept both forms. Dpkg
still prepends the "./": on my Debian testing system, the following bash
command
for deb in /var/cache/apt/archives/*.deb ; do
ar -p $deb control.tar.xz | xz -dc | tar tvf -
done
for all archived packages from "deb.debian.org" results in
drwxr-xr-x root/root 0 2020-02-13 06:14 ./
-rw-r--r-- root/root 436 2020-02-13 06:14 ./control
-rw-r--r-- root/root 176 2020-02-13 06:14 ./md5sums
drwxr-xr-x root/root 0 2020-02-13 06:14 ./
-rw-r--r-- root/root 760 2020-02-13 06:14 ./control
-rw-r--r-- root/root<PHONE_NUMBER>-02-13 06:14 ./md5sums
-rwxr-xr-x root/root 542 2020-02-13 06:14 ./postinst
drwxr-xr-x root/root 0 2020-02-13 06:14 ./
-rw-r--r-- root/root 629 2020-02-13 06:14 ./control
-rw-r--r-- root/root<PHONE_NUMBER>-02-13 06:14 ./md5sums
drwxr-xr-x root/root 0 2020-02-13 06:14 ./
-rw-r--r-- root/root 473 2020-02-13 06:14 ./control
-rw-r--r-- root/root 5029 2020-02-13 06:14 ./md5sums
Thus, if the patch does not work, packages created by dpkg will neither.
Andreas
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
https://github.com/bazelbuild/rules_pkg/pull/137?email_source=notifications&email_token=AAXHHHAKABCUXHG4SZG3SILRFE63PA5CNFSM4K57WBY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENL7APA#issuecomment-592965692,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAXHHHGOOHTUWJCE6H4QT23RFE63PANCNFSM4K57WBYQ
.

Cool. I.am ooo this week. Please ask another owner to merge.

Sure.
@philwo @fweikert Could one of you please take a look at this?


Recognize Prisma1 schemas and tell user to install the other extension and rename file

Right now, many Prisma1 users accidentally install this extension and then get a lot of errors because the content of the file of course is not valid.
The solution to their problem is to install https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql and change their file extension to .graphql so the new extension does not get triggered by default.
Maybe we can recognize GraphQL files and instead of just underlining everything as invalid, give the user some feedback what is going on and point them in the right direction?

Since the new prisma-fmt version this warning is not shown anymore, because during linting no error is thrown anymore.

related to #204

because during linting no error is thrown anymore.

Is that a bug in the formatter?

This is correct behavior according to @mavilein 👍


IO.pipe not working with Windows API?

Hey Jarib,
Not sure if I'm just doing something wrong but the following simple case seems to not work on Windows... but it should, since it is how libraries such as mixlib-shellout which powers Chef work with Windows1
require "rubygems"
require "childprocess"

proc = ChildProcess.build("ipconfig")

# Setup the stdout/stderr pipes
stdout, stdout_w = IO.pipe
stderr, stderr_w = IO.pipe
proc.io.stdout = stdout_w
proc.io.stderr = stderr_w
proc.duplex = true

proc.start

# Close our write handles, since we don't use them
stdout_w.close
stdout_err.close

# Wait for the process to exit
proc.wait

# Output the data:
p stdout.read
p stderr.read

The above will always output "" (empty string) for stdout and stderr, but if you remove all the pipe stuff (so the process just inherits the pipes), then it will properly output all the ipconfig data.
I'm not sure if I'm doing something wrong but its such a simple case I'm not sure how I can be.
Any ideas?

Note when I do a proc.io.stdout = STDOUT it does work fine, so the API appears to be working fine.
However, why don't pipes work here? They clearly work with the Windows API since the Opscode folks appear to use it successfully (mixlib-shellout is used by Chef which works fine on Windows)


Mark jumps into other functions as tail calls

We can mark them with an argument, as well as a flow marker (arrow from one frame to the other).
We may need to special-case this for OCaml-only, depending on how this interacts with other languages.

You know that most C compilers etc also generate jmp tail calls (see gcc -foptimize-sibling-calls)?
Also I'm not sure what this buys us; I think the current UI of "foo; bar" on the same line is a pretty clear indication of what happened?


Previously ran launch is always shown in the debug console

Steps to repro

Open VS Code repo
Launch Attach to Extension Host and it fails
Launch Git unit tests
Debug console has a dropdown for above two
Clear the console using clear action
Dropdown disappears
Launch Git unit tests again
🐛 Dropdown with Attach to Extension Host appears in the console

You have actually cleared the git unit tests debug console
And not the Attach to Extnesion Host which is left behind.
Once you start git again, the new session appears and the attach to extension host is there since it was not cleared (note you can not clear the last one).
For now closing as will not fix / as designed. If users complain about this and find it confusing I would be open to changing it.
Thanks


0.5.0 (release in Cocoapods) won't compile in Swift 5.1

Hi -
When installing via Cocoapods, the install succeeds, but when I run a build, I get a bunch of compilation errors. Looks like Cocoapods has version 0.5.0, which appears to be a couple years old, and there are 22 commits to master since that release in GitHub.
When I install using the "manual" method, everything compiles smoothly and I can fetch my inbox using the sample code as expected.
Maybe it's time for a release? :)

You can still use Cocoapods to pull from the master branch - but yes, a release is probably better!
pod 'Postal', :git => "https://github.com/snipsco/Postal.git", :branch => 'master'

any update on a new release?


NPM version still at 0.8

Hi, I noticed that the following code doesn't run as intended with the latest distribution builds from the release and develop branch:
square.bind('UpdateFrame', function(){
  this.rotation = this.rotation + 1;
});

However, using the build from the testing branch, the code above works as expected.
The documentation on 2D uses the testing build by default and changing it to use either release or develop breaks the demo.

I can't seem to reproduce -- if I change the demo in the docs to use the most recent release (0.9.0), it still works.
Could you check which version of Crafty are you using?

Aha, from looking at your other issue, I know what's going on -- I didn't update the node module with the 0.9 release.  :(
I'll update the issue title, and see about fixing this.

Hopefully fixed now?  The registry now has 0.9.0 as the latest version, though the package page hasn't updated yet.
I'll leave this issue open until I've confirmed that the package page is correct.

lovely! for some reason, I didn't get any notification that you replied to this ticket.


WsebTransportIT.testEchoAlignedDownstream sporadically failing

Gateway with version:
Can the bug be reproduced in a Kaazing demo out-of-the-box?
Steps to reproduce:  mvn clean install
Observed behavior:
Failed tests:
  WsebTransportIT.testEchoAlignedDownstream Specified behavior did not match expected:<...t WRITE_COMPLETE_B

[read [0x80 0x11]
read "Hello, WebSocket!"

close]d

# upstream reques...> but was:<...t WRITE_COMPLETE_B

[unboun]d

# upstream reques...>

Tests run: 14, Failures: 1, Errors: 0, Skipped: 2

Actual k3po execution from debugging in K3po

#
# Copyright (c) 2007-2014 Kaazing Corporation. All rights reserved.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# create request

connect tcp://localhost:8000
connected

write "GET /echo/;e/ct HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Accept-Encoding: gzip,deflate,sdch\r\n"
write "Accept-Language: en-US,en;q=0.8\r\n"
write "Connection: keep-alive\r\n"
write "Host: localhost:8000\r\n"
write "Referer: http://localhost:8000/?.kr=xs\r\n"
write "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36\r\n"
write "X-Origin: http://localhost:8000\r\n"
write "X-WebSocket-Version: wseb-1.0\r\n"
write "\r\n"

write notify CREATE_REQUESTED

read await CREATE_REQUESTED

read "HTTP/1.1 200 OK\r\n"
read "Content-Length: 196\r\n"
read "Content-Type: text/plain;charset=UTF-8\r\n"
read "Date: " /.*/ "\r\n"
read "Server: Kaazing Gateway\r\n"
read "\r\n"
read "HTTP/1.1 201 Created\r\n"
read "Content-Type: text/plain;charset=UTF-8\r\n"
read "\r\n"
read "http://localhost:8000" /(?<up>.*)/ "\n"
read "http://localhost:8000" /(?<down>.*)/ "\n"

read notify CREATED
close
closed

# downstream request (may not be thread aligned - different TCP connection)
connect tcp://localhost:8000
connected

write await CREATED

write "POST "
write ${down}
write " HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Accept-Encoding: gzip,deflate,sdch\r\n"
write "Accept-Language: en-US,en;q=0.8\r\n"
write "Connection: keep-alive\r\n"
write "Content-Length: 3\r\n"
write "Host: localhost:8000\r\n"
write "Referer: http://localhost:8000/?.kr=xs\r\n"
write "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36\r\n"
write "X-Origin: http://localhost:8000\r\n"
write "\r\n"

# payload sent by Flash client runtime to prevent the POST converting to GET and stripping the headers off the request (!)
write ">|<"

read "HTTP/1.1 200 OK\r\n"
read "Cache-Control: no-cache\r\n"
read "Connection: close\r\n"
read "Content-Type: text/plain;charset=windows-1252\r\n"
read "Date: "
read /.*/ "\r\n"
read "Server: Kaazing Gateway\r\n"
read "X-Content-Type-Options: nosniff\r\n"
read "\r\n"
read "HTTP/1.1 200 OK\r\n"
read "Content-Type: text/plain; charset=windows-1252\r\n"
read "X-Idle-Timeout: 60\r\n"
read "\r\n"

read [0x01 0x30 0x30 0xff]

read await WRITE_COMPLETE_A

read [0x80 0x11]
read "Hello, WebSocket!"

read await WRITE_COMPLETE_B

unbound

# upstream request (may not be thread aligned - different TCP connection)
connect tcp://localhost:8000
connected

write await CREATED

write "POST "
write ${up}
write " HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Accept-Encoding: gzip,deflate,sdch\r\n"
write "Accept-Language: en-US,en;q=0.8\r\n"
write "Connection: keep-alive\r\n"
write "Content-Length: 25\r\n"
write "Content-Type: text/plain; charset=UTF-8\r\n"
write "Host: localhost:8000\r\n"
write "Origin: http://localhost:8000\r\n"
write "Referer: http://localhost:8000/?.kr=xs\r\n"
write "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36\r\n"
write "X-Origin: http://localhost:8000\r\n"
write "\r\n"

write [0xc2 0x80 0x11]
write "Hello, WebSocket!"

write [0x01 0x30 0x32 0xc3 0xbf]    # wse.close
write [0x01 0x30 0x31 0xc3 0xbf]    # wse.reconnect

read "HTTP/1.1 200 OK\r\n"
read "Content-Length: 19\r\n"
read "Content-Type: text/plain;charset=UTF-8\r\n"
read "Date: "
read /.*/ "\r\n"
read "Server: Kaazing Gateway\r\n"
read "\r\n"
read "HTTP/1.1 200 OK\r\n"
read "\r\n"

read notify WRITE_COMPLETE_B

close
closed

Expected behavior:
Expected k3po execution from debugging in K3po
#
# Copyright (c) 2007-2014 Kaazing Corporation. All rights reserved.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# create request

connect tcp://localhost:8000
connected

write "GET /echo/;e/ct HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Accept-Encoding: gzip,deflate,sdch\r\n"
write "Accept-Language: en-US,en;q=0.8\r\n"
write "Connection: keep-alive\r\n"
write "Host: localhost:8000\r\n"
write "Referer: http://localhost:8000/?.kr=xs\r\n"
write "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36\r\n"
write "X-Origin: http://localhost:8000\r\n"
write "X-WebSocket-Version: wseb-1.0\r\n"
write "\r\n"

write notify CREATE_REQUESTED

read await CREATE_REQUESTED

read "HTTP/1.1 200 OK\r\n"
read "Content-Length: 196\r\n"
read "Content-Type: text/plain;charset=UTF-8\r\n"
read "Date: " /.*/ "\r\n"
read "Server: Kaazing Gateway\r\n"
read "\r\n"
read "HTTP/1.1 201 Created\r\n"
read "Content-Type: text/plain;charset=UTF-8\r\n"
read "\r\n"
read "http://localhost:8000" /(?<up>.*)/ "\n"
read "http://localhost:8000" /(?<down>.*)/ "\n"

read notify CREATED
close
closed

# downstream request (may not be thread aligned - different TCP connection)
connect tcp://localhost:8000
connected

write await CREATED

write "POST "
write ${down}
write " HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Accept-Encoding: gzip,deflate,sdch\r\n"
write "Accept-Language: en-US,en;q=0.8\r\n"
write "Connection: keep-alive\r\n"
write "Content-Length: 3\r\n"
write "Host: localhost:8000\r\n"
write "Referer: http://localhost:8000/?.kr=xs\r\n"
write "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36\r\n"
write "X-Origin: http://localhost:8000\r\n"
write "\r\n"

# payload sent by Flash client runtime to prevent the POST converting to GET and stripping the headers off the request (!)
write ">|<"

read "HTTP/1.1 200 OK\r\n"
read "Cache-Control: no-cache\r\n"
read "Connection: close\r\n"
read "Content-Type: text/plain;charset=windows-1252\r\n"
read "Date: "
read /.*/ "\r\n"
read "Server: Kaazing Gateway\r\n"
read "X-Content-Type-Options: nosniff\r\n"
read "\r\n"
read "HTTP/1.1 200 OK\r\n"
read "Content-Type: text/plain; charset=windows-1252\r\n"
read "X-Idle-Timeout: 60\r\n"
read "\r\n"

read [0x01 0x30 0x30 0xff]

read await WRITE_COMPLETE_A

read [0x80 0x11]
read "Hello, WebSocket!"

read await WRITE_COMPLETE_B

read [0x80 0x11]
read "Hello, WebSocket!"

closed

# upstream request (may not be thread aligned - different TCP connection)
connect tcp://localhost:8000
connected

write await CREATED

write "POST "
write ${up}
write " HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Accept-Encoding: gzip,deflate,sdch\r\n"
write "Accept-Language: en-US,en;q=0.8\r\n"
write "Connection: keep-alive\r\n"
write "Content-Length: 25\r\n"
write "Content-Type: text/plain; charset=UTF-8\r\n"
write "Host: localhost:8000\r\n"
write "Origin: http://localhost:8000\r\n"
write "Referer: http://localhost:8000/?.kr=xs\r\n"
write "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36\r\n"
write "X-Origin: http://localhost:8000\r\n"
write "\r\n"

write [0xc2 0x80 0x11]
write "Hello, WebSocket!"

write [0x01 0x30 0x32 0xc3 0xbf]    # wse.close
write [0x01 0x30 0x31 0xc3 0xbf]    # wse.reconnect

read "HTTP/1.1 200 OK\r\n"
read "Content-Length: 19\r\n"
read "Content-Type: text/plain;charset=UTF-8\r\n"
read "Date: "
read /.*/ "\r\n"
read "Server: Kaazing Gateway\r\n"
read "\r\n"
read "HTTP/1.1 200 OK\r\n"
read "\r\n"

read notify WRITE_COMPLETE_B

close
closed

Gateway Java version  Java 8
Server OS with version:
Back-End System with version
Client Technology:
Browser with Version:
Client O/S with Version:  {{field10}}
Does the bug reproduce with all emulated or native combinations?  {{field11}}
Is this a regression from previous released version?  {{field12}}
Does this reproduce in a later released version? {{field 13}}
Gateway config, if applicable:  {{field14}}

k3po/k3po#142 needs to be fixed for this to work

k3po/k3po#142 Fix is in, this should fix this


How to compile with Libcurl support?

Hi, it looks like --with-libcurl is not currently supported.
I'm getting a warning message when I'm trying to specify it:
configure: WARNING: unrecognized options: --with-libcurl

--with-libcurl is fine, warning may be there because in some "all in one" scripts we provide this flag to all packages, but the only one needing this option is libmediainfo.

I'm expecting that all required libraries will be statically linked, but they don't. What I missed?

Idea behind  --enable-static is to build all required non system libs (the ones in the packages you downloaded) as static, and libcurl is a system lib (not in the package) in theory easily available on your target machine, so not needed in static builds by everyone.
You may try to add  --enable-staticlibs for what you are looking for.

I got it, thanks! I'll copy libcurl from the build machine.

have a node8 lambda function working correctly. trying to migrate to node10 and running the mediainfo build process under an amazonlinux2 docker image and hitting the same issues in this issue. if i run with --enable-static, i get the error above with libcurl.so.4 cannot open shared object.

I'm expecting that all required libraries will be statically linked, but they don't. What I missed?

Idea behind  --enable-static is to build all required non system libs (the ones in the packages you downloaded) as static, and libcurl is a system lib (not in the package) in theory easily available on your target machine, so not needed in static builds by everyone.
You may try to add  --enable-staticlibs for what you are looking for.

Hi @JeromeMartinez
As above running into this issue, but --enable-staticlibs is giving me further error on build:
Reader_libcurl.cpp:(.text+0x97e1): undefined reference to `curl_easy_getinfo'
collect2: error: ld returned 1 exit status
make: *** [mediainfo] Error 1
Problem while compiling MediaInfo (CLI)
How can I include this?
@bushev how did you resolve exactly?

Hi guys, I had the same problem upgrading AWS Lambda runtime from nodejs 8 to 10/12 that my old mediainfo static file fails, so I build @g-maxime 's docker file and get the new mediainfo file along with libcurl.so.4 and libcurl.so.4.5.0 files but still got this: error while loading shared libraries: libnghttp2.so.14: cannot open shared object file: No such file or directory , can somebody just for sake of testing upload his current static working files with the newer nodejs version? Thanks in advance!

can somebody just for sake of testing upload his current static working files with the newer nodejs version?

Check files with "Lambda" in their name in our development snapshots.

It works! Thanks @JeromeMartinez ❤

Thanks to @g-maxime's Dockerfile I managed to build a lambda compatible version of mediainfo (awesome project BTW, guys!).
Quick note for the next person trying this:
It seems that now you need perl-core in order to build openssl so make sure you also yum install perl-core as described at https://github.com/openssl/openssl/blob/master/NOTES-Perl.md

The lambda download of mediainfo in the download area did not work for me. The one from the latest development snapshot that @JeromeMartinez linked to did work. Maybe the website download area needs updating to the latest compiled lambda version.

An official new release is planned next week, we'll update the website at this moment.

One more thing. With  @g-maxime docker file it seems you still need to grab the .so libs for it to work. The only version I have found built or Docker that works with just the mediainfo file alone and no other files is the latest dev snapshot for lambda.

@cloudtagger What is the error?
If I run ldd against the mediainfo binary from the docker image, I get only basic system dependencies:
	linux-vdso.so.1 (0x00007ffc90b55000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f8933b0a000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f8933b03000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8933ae1000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f89338f1000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f89337ab000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8933790000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f89335c4000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f8933b4d000)

Just to be clear about the .so "issue", we talk about the corresponding libmediainfo development snapshots, right?

In lambda I get that mediainfo can't find libcurl. don't know why. maybe I need to try again and see.

@cloudtagger I am facing similar issue , I also have raised an issue (https://github.com/iandow/mediainfo_aws_lambda/issues/4). Please let me know if you make some progress.

A bit of information to try and clear up some of the confusion: it makes a huge difference which "lambda runtime" you are running in.
Have a look at https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
What I found is that running in the Python 2.7 runtime everything is rosy - all the libs are already available.
However in Node.js 12 there are lots of libs missing.
I note that the former claims to use Amazon Linux while the latter claims Amazon Linux 2.
However, that does not seem to be all there is to it - because if you start an EC2 instance with Amazon Linux 2 then you do get those libs.
It seems that at least some of the Lamdba runtimes are totally stripped down.
So - be aware that a mediainfo build that works in one Lambda runtime does not necessarily work in all runtimes :(
I noted above that  @g-maxime's Dockerfile worked for me (after some updates) and that was in Node.js 12 runtime.
The one issue with his procedure is that it builds from latest source of underlying libs - so it will bitrot.

I was running into this issue and preferred not to use a layer, so I downloaded the layer locally, unzipped it, and included the binary w/ my lambda source code bundle.
This seems to be working for me so far, although I may end up using a layer eventually.

So - be aware that a mediainfo build that works in one Lambda runtime does not necessarily work in all runtimes :(

We are not aware of any "non compatible" Amazon Linux version, now we support both Amazon Linux (the previous versions were working only on this one because libcurl is missing in the new one, and the current versions work on it as we "just" included libcurl in our binary without breaking something else) and Amazon Linux 2.


No songs available to display.

When I run my bot and play music for under 10 minutes, it just crashes with this feedback

I haven't had this problem before, Though i'll look into it!

Could you please provide the stack trace?
And the version of Discord portable player your using? (npm ls discord-portable-player) and your node-version!

node version: v16.16.0
discord-portable-player version: ^2.1.6

Could you leave a DM for me on Discord?
Tag: Nex ♪#2221

It's caused when toString is called when there's no songs available.
SRC: https://github.com/lolollllo/discord-portable-player/blob/a3b9defd6cd8ba75a314fae8b7fb3bdcd458304e/src/Structures/Queue.ts#L784

If you have less than 2 tracks, the error will be thrown as well!


how to love a project

this is not actually a bug, but is there any way to love a project? i have tried playing around with the scratch api manually, and i can do it there.. is there a way of doing it with scratchclient as well?

not telling to avoid abuse

session.get_project(id).love()


fix xschemrc

Fixes #112
It also makes it more similar to the SKY130 xschemrc.

[x] Tests pass
See "Testing" section below
[x] Appropriate changes to README are included in PR
No changes to the README are required.

Testing

[x] the default schematic opens up when
[x] test_nfet_0.v3.sch is successful:

Will someone please rerun the CLA check?
I've now signed it.

@proppy and @mithro, can you guys take a look and merge if the fix for the xschemrc is acceptable?

I feel like there is a lot of layers for this to propogate through for it to end up fixing the  iic-osic-tools Issue #9

Merge this one
The PDK repo this is used in
openpdks
iic-osic-tools

so I just saw #112 which helps complement the issues fixed by this PR.

cc: @atorkmabrains @StefanSchippers
Let me know if you have any comments on these fixes

@QuantamHD, you seem to have merged the last PR that was merged, can you take a look?

Still seems like you're missing the CLA check. Other than a few minor questions. LGTM

Google says I have signed the CLA.

@QuantamHD
Can any of the 29 previous PRs be merged?  A lot of them seem ready.

I'll try to make my way through them. I'll merge this once the DRC passes.

Are there any high priority PRs you need. A lot of them have merge conflicts or CI failures. I want to prioritize what's most important to you.

Thanks for merging!
@QuantamHD


React 项目添加自定义插件时控制台报错

Describe the bug
提供了一个最小复现 repo，我希望做一个自定义插件，希望在启动项目时进行一写操作，故在 configResolved 钩子中定义了实现方法。达到我的预期了，并且服务可以正常启动。但是打开浏览器控制台会有一个错误信息，页面无法渲染。
Reproduction
https://github.com/Wxh16144/vite-react-ts-repo-debug
Steps to reproduce
查看 READEME.md 说明
System Info
System:
    OS: macOS 12.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 100.31 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.0/bin/yarn
    npm: 8.12.1 - ~/.nvm/versions/node/v16.13.0/bin/npm
    Watchman: 2<IP_ADDRESS> - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 107.0.5304.110
    Safari: 16.1
  npmPackages:
    @vitejs/plugin-react: ^2.2.0 => 2.2.0
    vite: ^3.2.3 => 3.2.4

Used Package Manager
pnpm
Logs
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

The sub build might make some global state pollution to Vite dev mode, so it ran unexpectedly in dev mode but OK in vite build.
The production build is disposable but dev mode is continuous. So if there are nested dev and prod tasks, I suggest wrapping into script and run in separate scope, such as child process.
configResolved() {
  // spawn a child process to build
  const proc = execa("node", [`${__dirname}/build-globalValue.js`])
  proc.stdout.pipe(process.stdout);
  proc.stderr.pipe(process.stderr);
}

When building, Vite will use production as the default mode, so process.env.NODE_ENV will be set to production, which may lead to lousy client code transformation if you execute it within the dev server.
For this case, you could explicitly set mode as not production:
vite({
  mode: 'customBuild',
  configFile: false,
  build: {
    lib: {
      //...
    },
  },
})

But...maybe Vite needs to double-check process.env.NODE_ENV when handling client code transformation.
Hope this helps.

thank you very much for your reply, I will take the time to verify the solution you provided and try it. thanks


Bug report, need more checks to see the deploymentconfig / RC is 100% up..

[kind/bug]

What versions of software are you using?

Operating System: The awesome Linux OS

Output of odo version: Using PR: https://github.com/openshift/odo/pull/1541

How did you run odo exactly?
Use odo push multiple times very quickly...
This results in an error as the application has yet to 100% come up.
Actual behavior
So what's happening is that we're (most likely) not checking to see that DeploymentConfig has been properly deployed / the component is actually up (replication controller too judging from the OpenShift logs)
github.com/openshift/odo  bug-hunting-2-deploys ✔
▶ ./odo push --context ~/nodejs-ex
 ✓  Checking component
 ✓  Checking component version
 ✓  Applying component settings to component: nodejs-sxmy
 ✓  The component nodejs-sxmy was updated successfully
 ✓  Successfully created component with name: nodejs-sxmy
 ✓  Pushing changes to component: nodejs-sxmy of type local
 ✓  Waiting for component to start
 ✓  Copying files to component
 ◒  Building component ✗  Unable to build files
+ set -eo pipefail
+ '[' '!' -z /opt/app-root/src ']'
+ '[' /tmp '!=' /opt/app-root/src ']'
+ '[' -n /opt/app-root/src-backup ']'
+ '[' '!' -d /opt/app-root/src-backup ']'
+ rsync -rlO /tmp/src/. /opt/app-root/src-backup/src/
+ b_IFS='
'
+ b_OFS=
+ OIFS='
'
+ IFS='
'
++ ls -A /tmp/src/
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/.dummy
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/.gitignore
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/.odo
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/.odoignore
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/README.md
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/foo
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/foobar
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/helm
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/openshift
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/package.json
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/server.js
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/tests
+ for file in '`ls -A ${ODO_S2I_SRC_BIN_PATH}/src/`'
+ rm -fr /opt/app-root/src/views
+ OIFS=
+ IFS='
'
+ '[' -n bucharestgold/centos7-s2i-nodejs ']'
+ '[' bucharestgold/centos7-s2i-nodejs == redhat-openjdk-18/openjdk18-openshift ']'
+ '[' -f /tmp/src/.s2i/bin/assemble ']'
+ '[' -n /usr/libexec/s2i ']'
+ rm -rf /opt/app-root/src/.git
+ /usr/libexec/s2i/assemble
---> Installing application source
---> Building your Node application from source
Current git config
<EMAIL_ADDRESS>url.https://.insteadof=ssh://
<EMAIL_ADDRESS>---> Installing dependencies
---> Using 'npm install -s --only=production'

 ✗  Building component
 ✗  command terminated with exit code 137

Expected behavior
No errors / full deployment comes up
Any logs, error output, etc?

wasn't this fixed in #1541?

@kadel Yup. Closing this issue.


MF Fixing MGRS GRG issues

Initial fix for Create Reference System GRG From Area tool in GRG tools.
Description
Several initial fixes for smaller, easier-to-fix problems found during testing.
More complex fixes to follow, and might be appended to this PR.
Related Issue
@elinz please update and close the following issues as part of the review.
#613 - changed name of tool and parameters (doc and tests updated also)
#616 - output field name updated (testdata updated)
#618 - removed extraneous fields from GZD output
Motivation and Context
Fixing issues found during testing.
How Has This Been Tested?
Manual and automated tests passing.
Screenshots (if appropriate):
Types of changes

[X] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[X] My code follows the code style of this project.
[X] My change requires a change to the documentation.
[X] I have updated the documentation accordingly.
[X] I have read the CONTRIBUTING document.

@mfunk I've verified the fixes for #613, #616, and #618.

Thanks @elinz I need you to Review the PR and Approve it if all is OK. Can't Merge without an approval. Thanks.


FileNotFoundError: [Errno 2] No such file or directory: 'dataset_files/ego_mean_std.pkl'

Hello, First I want to express my appreciation for your fantastic work and contribution.
While running your code on Windows 10, I encounter this error.
"FileNotFoundError: [Errno 2] No such file or directory: 'dataset_files/ego_mean_std.pkl'"
Could you please provide me with information on where I can download the "ego_mean_std" file?

I uploaded the ego_mean_std file, the problem should have been solved now.

Thanks for providing the missed file.
I eventually ran the demo successfully and reached great results.
The results that I could see through your visualization script were the skeleton motion of the person.
Could you please guide me on how I can show results on the human shape body model like the first two videos you provided on this page?
https://people.mpi-inf.mpg.de/~jianwang/projects/egowholemocap/index.html

The SMPL human motion is obtained by solving IK on estimated joints. You can refer to vposer and easymocap for the IK solutions.
https://github.com/nghorbani/human_body_prior
https://github.com/zju3dv/EasyMocap?tab=readme-ov-file
You can also use other ik tools to drive any rigged human model.

Thanks again for your help.
Is there a simple way to convert the obtained mo2cap2 key points to the SMPL format?
I couldn't find the mo2cap2 format in the standard formats of key points converters provided by mmhuman3d. (https://github.com/open-mmlab/mmhuman3d/blob/main/docs/keypoints_convention.md)

The Mo2Cap2 format and other joint formats are under:
https://github.com/jianwang-mpi/egowholemocap/tree/main/mmpose/data/keypoints_mapping

Thanks for the information. Could you please guide me on how to convert from one format to another?
I have a script that converts the PKL file to FBX. However, it only works on SMPL key points format.
So, I need to convert the mo2cap2 format to SMPL, do you know any script or simple way to do that?

There is no simple way to do that. As I said, I use the IK solutions to convert the mo2cap2 joints to smpl parameters. You can follow the https://github.com/nghorbani/human_body_prior to do that.
The basic idea is to modify the loss function in the optimization process in the following way:

convert the current SMPL joint optimization results to mo2cap2 format with key points mapping
calculate the converted mo2cap2 optimization results with mo2cap2 predictions by the network

such approach can also be seen in the visualization code of motion diffusion models https://github.com/GuyTevet/motion-diffusion-model

Thank you very much for providing such a comprehensive guide.

Thanks again for your guidance.
I was finally able to visualize the Egocentric output on a SMPL model.
I was wondering what script or software you used to visualize key points like simple points and chains in 3D coordinates. (Please see the attached pictures).

I was using blender for rendering.
If you are not familiar with blender, i recommend using pyrender. It can render from python script.


added API for ql as datasource

Proposed changes
Added a new API /v2/<entityId> for ql to act as datasource. Fix for issue #102
Types of changes
What types of changes does your code introduce to the project: Put
an x in the boxes that apply

[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)

Checklist
Put an x in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to
ask. We're here to help! This is simply a reminder of what we are going
to look for before merging your code.

[x] I have read the CONTRIBUTING doc
[x] I have signed the CLA
[x] I have added tests that prove my fix is effective or that my
feature works
[ ] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in
downstream modules

Further comments
If this is a relatively large or complex change, kick off the discussion
by explaining why you chose the solution you did and what alternatives
you considered, etc...

rather than having a new end point, the endpoint should be /v2/entities/{entityId} the new behaviour could be triggered by a query parameter (e.g. ?datasource=true)
the returned format should be the same as the one of ngsi entity not the timeseries version of it, e.g.:

{
      "id": "Kitchen1",
      "type": "Kitchen",
      "temperature": {
        "value": 35.6,
        "type": "Number"
      },
     "dateModified": "value from time index"
  }

the returned value, should be the last value based on the time_index

Hi @chicco785 I have updated the code as per your comment. Please check and let me know if any further change is required.

to complete the testing, we should add in the integration test something that:

push an entity into quantumleap
register the datasource endpoint for that entity in orion
check that orion can retrieve the entity via ql

I am working on this. I will update PR once changes are done.

Hi @chicco785
I have tried to add integration test which you have suggested. Please find my below findings:
I have registered the ql endpoint in orion as datasource using API:
(curl localhost:1026/v1/registry/registerContext -s -S --header 'Content-Type: application/json' \
    --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "contextRegistrations": [
        {
            "entities": [
                {
                    "type": "Test",
                    "isPattern": "false",
                    "id": "Test1"
                }
            ],
            "attributes": [
                {
                    "name": "temperature",
                    "type": "integer"
                }
            ],
            "providingApplication": "http://localhost:8668/v2/entities/Test1%3Fdatasource%3Dtrue"
        }
    ],
    "duration": "P1M"
}
EOF

%3F and %3D is encoded character for ? and = respectively.
But when I send query request to orion as:
(curl localhost:1026/v1/queryContext -s -S --header 'Content-Type: application/json' \
    --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "entities": [
        {
            "type": "Test",
            "isPattern": "false",
            "id": "Test1"
        }
    ],
    "attributes": [
    ]
}
EOF

It returned:
{
    "errorCode": {
        "code": "404",
        "details": "invalid context provider response",
        "reasonPhrase": "No context element found"
    }
}

When I checked orion logs, I found:
 POST http://localhost:8668/v2/entities/Test1%3Fdatasource%3Dtrue/queryContext, request payload (114 bytes): {"entities":[{"type":"Test","isPattern":"false","id":"Test1"}],"attributes":["temperature"]}, response payload (0 bytes): , response code: Couldn't connect to server

As per my observation Orion add /queryContext to the url in providingApplication.
This may be the issue with Orion. We should clarify this orion community.

Hi @chicco785
I have tried to add integration test which you have suggested. Please find my below findings:
I have registered the ql endpoint in orion as datasource using API:
(curl localhost:1026/v1/registry/registerContext -s -S --header 'Content-Type: application/json' \
    --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "contextRegistrations": [
        {
            "entities": [
                {
                    "type": "Test",
                    "isPattern": "false",
                    "id": "Test1"
                }
            ],
            "attributes": [
                {
                    "name": "temperature",
                    "type": "integer"
                }
            ],
            "providingApplication": "http://localhost:8668/v2/entities/Test1%3Fdatasource%3Dtrue"
        }
    ],
    "duration": "P1M"
}
EOF

%3F and %3D is encoded character for ? and = respectively.
But when I send query request to orion as:
(curl localhost:1026/v1/queryContext -s -S --header 'Content-Type: application/json' \
    --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "entities": [
        {
            "type": "Test",
            "isPattern": "false",
            "id": "Test1"
        }
    ],
    "attributes": [
    ]
}
EOF

It returned:
{
    "errorCode": {
        "code": "404",
        "details": "invalid context provider response",
        "reasonPhrase": "No context element found"
    }
}

When I checked orion logs, I found:
 POST http://localhost:8668/v2/entities/Test1%3Fdatasource%3Dtrue/queryContext, request payload (114 bytes): {"entities":[{"type":"Test","isPattern":"false","id":"Test1"}],"attributes":["temperature"]}, response payload (0 bytes): , response code: Couldn't connect to server

As per my observation Orion add /queryContext to the url in providingApplication.
This may be the issue with Orion. We should clarify this with orion community.

not sure this is due to the fact that you tested v1 registration and hence it expects v1 data format, maybe try with v2 api:
https://fiware-orion.readthedocs.io/en/1.15.0/user/walkthrough_apiv2/index.html#context-availability-management
otherwise, something in the format we use is not correct :(

apparently, is a bit more complex that what we thought, here you can find an example of a context provider: https://github.com/FIWARE/tutorials.NGSI-v2/tree/master/context-provider
basically we would need a whole new endpoint: /op/query (as post, not get), and this endpoint would need to accept requests in the format of NGSIv2 /op/query endpoint:
https://fiware.github.io/specifications/ngsiv2/stable/
i.e.: something like:
{
  "entities": [
    {
      "idPattern": ".*",
      "type": "Room"
    },
    {
      "id": "Car",
      "type": "P-9873-K"
    }
  ],
  "attrs": [
    "temperature",
    "humidity"
  ],
  "expression": {
    "q": "temperature>20"
  },
  "metadata": [
    "accuracy",
    "timestamp"
  ]
}

In our case we can skip expression (we don't support them) and metadata (we don't store them). Moreover, as initial implementation, we can disregard the usage of patterns and support only explicit id and type. This should make it simple enough to implement it starting from what you coded so far. Feelings?

sure, First I will confirm orion v2/registrations behaviour then update PR as per your suggestion.

@chicco785 I checked with orion /v2/registrations, I found that orion append /queryContext to the provider url.
So we need to create a new API as /v2/op/queryContext which will respond to POST request received from orion. I am working on it and update the PR once changes are done.

this function I developed may be of help:
https://github.com/orchestracities/ngsi-timeseries-api/blob/master/src/translators/sql_translator.py#L1205
it also leverages the modified format_response function now is able to format messages for single point in time value entities:
https://github.com/orchestracities/ngsi-timeseries-api/blob/master/src/translators/sql_translator.py#L1415

@chicco785 I have updated the code as per our discussion. Please verify if it ok then I'll add test cases for the same.
I have executed below request:
(curl localhost:8668/v2/op/queryContext -s -S --header 'Content-Type: application/json' \
    --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "entities": [
        {
            "type": "TestNew",
            "isPattern": "false",
            "id": "TestNew1"
        },
        {
            "type": "Test",
            "isPattern": "false",
            "id": "Test1"
        }
    ],
    "attributes": [
        "temperature",
        "intensity"
    ]
}
EOF

and received response as:
[
    [
        {
            "dateModified": "2021-08-24T19:57:22.731+00:00",
            "id": "TestNew1",
            "intensity": {
                "type": "Text",
                "value": "Low"
            },
            "temperature": {
                "type": "Number",
                "value": 22.0
            },
            "type": "TestNew"
        }
    ],
    [
        {
            "dateModified": "2021-08-24T19:55:15.701+00:00",
            "id": "Test1",
            "intensity": {
                "type": "Text",
                "value": "Low"
            },
            "temperature": {
                "type": "Number",
                "value": 22.0
            },
            "type": "Test"
        }
    ]
]

Please let me know if any further change is required.

is query or queryContext, according to the docs it should be query in ngsi v2, while it's queryContext in ngsi v1 (see spec: https://fiware.github.io/specifications/ngsiv2/stable/ ) but implementation may be different...
also the input message according to ngsi v2 spec should be like:
{
  "entities": [
    {
      "id": "TestNew1",
      "type": "TestNew"
    },
    {
      "id": "Test1",
      "type": "Test"
    }
  ],
  "attrs": [
    "temperature",
    "intensity"
  ]
}

also, when doing validation, if the posted request includes idPattern or expression or metadata, we should return a message "not supported", e.g.:
{
  "entities": [
    {
      "idPattern": ".*",
      "type": "Room"
    }
  ],
  "expression": {
    "q": "temperature>20"
  },
  "metadata": [
    "accuracy",
    "timestamp"
  ]
}

@chicco785 I have updated the code as per our discussion. Please verify if it ok then I'll add test cases for the same.
I have executed below request:
(curl localhost:8668/v2/op/queryContext -s -S --header 'Content-Type: application/json' \
    --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "entities": [
        {
            "type": "TestNew",
            "isPattern": "false",
            "id": "TestNew1"
        },
        {
            "type": "Test",
            "isPattern": "false",
            "id": "Test1"
        }
    ],
    "attributes": [
        "temperature",
        "intensity"
    ]
}
EOF

and received response as:
[
    [
        {
            "dateModified": "2021-08-24T19:57:22.731+00:00",
            "id": "TestNew1",
            "intensity": {
                "type": "Text",
                "value": "Low"
            },
            "temperature": {
                "type": "Number",
                "value": 22.0
            },
            "type": "TestNew"
        }
    ],
    [
        {
            "dateModified": "2021-08-24T19:55:15.701+00:00",
            "id": "Test1",
            "intensity": {
                "type": "Text",
                "value": "Low"
            },
            "temperature": {
                "type": "Number",
                "value": 22.0
            },
            "type": "Test"
        }
    ]
]

Please let me know if any further change is required.

I have done the changes as discussed. Please check and let me know if any further change is required.

@pooja1pathak thanks for this valuable contribution!


ADD - RequestModifier, to provide low-level request modification. Exa…

Add RequestModifier
Request Modifier
Action<HttpContext, HttpClient> RequestModifier: provides more low level access for modifying the proxied request.
For example:

When you want to inject Bearer token in multi-services scenario without exposing the token to client's  Javascript.

Here's an example of usage:
new ProxyRule {
    // ...
    Modifier = (req, user) => {
        req.RequestUri = new Uri(
            $"https://protected-backend.com{req.RequestUri.PathAndQuery}"
        );
    },
    RequestModifier = async (ctx, client) =>
    {
        var user = ctx.User;
		if(user != null && user.Identity.IsAuthenticated)
		{
		    var accessToken = await context.GetTokenAsync("access_token");
			client.SetBearerToken(accessToken);
		}
    }
}

I would suggest to change RequestModifier in something else, since Action<HttpRequestMessage, ClaimsPrincipal> Modifier is already the actual response modifier, and the delegate you added don't give access to the Response, but it does for the HttpClient.
The example you are using is also very dangerous, because the HttpClient instance is the same for the entire lifetime of the middleware, every user would share the same bearer token. Exposing the HttpClient instance in this way can only leads to issues, so I don't think this implementation could actually be useful.

Actually what we need is Action<HttpRequestMessage, HttpContext> Modifier , so that we can inject token inside RequestMessge
Modifier = async (msg, ctx) =>
                        {
                            var uri = new UriBuilder($"{appSettings.ApiHostUrl}{msg.RequestUri.LocalPath}");
                            var user = ctx.User;
                            if(user != null && user.Identity.IsAuthenticated)
                            {
                                var accessToken = await ctx.GetTokenAsync("access_token");
                                msg.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer",accessToken);
                            }

                            msg.RequestUri = uri.Uri;
                        }

Leaving apart that this is a breaking change, why should you need to call GetTokenAsync() inside the request modifier? You could do this exact same operation just before in the pipeline, just like in this comment: https://github.com/SharpTools/SharpReverseProxy/issues/17#issuecomment-370770317
app.Use comes very useful to do operations like this in the pipeline. In you case you could set the Authorization header like it should be.
One question: How is the user authenticated to the service, but still needs a token set for the proxied request? Is the authentication to the proxy different than the one for the backend? Why don't you remove the authentication in the backend and restrict access to the backend by only accepting request from the Reverse Proxy? Just curious, maybe I made wrong assumptions about your infrastructure.

Here is the scenario that I want to solve:

WebAppUI

Provide UI access to the user, using Angular or any js
Protected with authentication provider. Let say Google etc.
User accessing to WebAppUI, will be authenticated by Google and redirected back to WebAppUI
WebAppUI - proxying /api/ to WebBackEnd and with user's access_token (as user)

WebBackend

Provide API service
Protected with authentication provider. Let say Google etc. (SSO with WebAppUI)

So, the Authentication in WebAppUI is not enough; since from my understanding it only checks if request is Authenticated. However, the communication between WebAppUI and WebBackend through proxy is not protected.
If WebBackend requires authentication (SSO with WebAppUI), then bearer token should be added to the request to WebBackend via proxy.
The WebAppUI can 'expose' bearer token in client side - but by injecting bearer token in proxy it hides access token from client browser.

Mmm could you expose WebBackend directly to the internet, like WebAppUi and uses the same authentication method? This would solve this issue and it would be a less complicated infrastructure.
Or a even more common approach would be to expose Ui and API from WebAppUi publicly (with authentication) and the backend is only called server-side by WebAppUi. You would still have a secure backend, while removing the use of a reverse proxy.

Although WebBackend is exposed to the internet, a client browser (let say an ajax in JQuery) needs to include access token in its request header. It means that the access token will be visible to naked eye.
The WebAppUI , role ini this scenario is just injecting the access token and forward entire request to WebBackend; as if its a server side without server side implementation in WebAppUI and moreover hiding the access token. Its very useful in micro services.

The behaviour you are describing is how the web works (or at least how I know it).
Anyway, best practice or not, I don't think this PR could actually be useful to anyone, since you can already do that without those changes like I posted before.
Even if you really need the HttpContext in your proxy modifier, you can create a class that contains all the SharpReverseProxy delegates, include in the DI and inject a IHttpContextAccessor into it:
public class ReverseProxyDelegates
{
    private IHttpContextAccessor _httpContext;

    public ReverseProxyDelegates(IHttpContextAccessor httpContextAccessor)
    {
        _httpContext = httpContextAccessor;
    }

    // All your delegates
}

and map the methods to the middleware:
app.UseProxy(new ProxyOptions
{
    ProxyRules = new List<ProxyRule>
    {
        new ProxyRule {
            Matcher = uri => Task.Run(async () => await serviceProvider.GetRequiredService<ReverseProxyDelegates>().ProxyUrlMatcher(uri)).Result,
            Modifier = (req, user) => serviceProvider.GetRequiredService<ReverseProxyDelegates>().ProxyRequestModifier(req, user).GetAwaiter().GetResult(),
            ResponseModifier = async (res, ctx) => await serviceProvider.GetRequiredService<ReverseProxyDelegates>().ProxyResponseModifier(res, ctx),
            PreProcessResponse = false,
            RequiresAuthentication = false
        }
    }
});

Note that all the delegates include a call to GetRequiredService<T>, where I ask for an instance of ReverseProxyDelegates using the DI. ReverseProxyDelegates is registered as a Scoped service.
Using this approach you can inject anything in the ReverseProxyDelegates class, so you won't need any additional implementations from the middleware.

@samusaran I couldn't agree more with your last comment.
I guess @cakriwut can achieve what he wants without any modification to the project.
@cakriwut , can you confirm that? If @samusaran 's approach solves your problem, I will close this pull-request.

Thanks @samusaran  & @andrecarlucci , very elegant. I absolutely agree that the PR is not necessary.


Add a page unload warning message.

Also, inform user in case he attempts to close window after curation
but done button has failed.
Signed-off-by: Vivek Rai<EMAIL_ADDRESS>

@yeban Want your comment before closing this stale PR.

I don't want to loose the code.


Fix CI and add Python3.10 support

Three minor tasks:

[x] Fix CI is failling multiple tests with the same issue FileNotFoundError: [Errno 2] No such file or directory: 'chrome'.
[x] Fix Selenium's deprecation warning.
[x] Update CI to add Python 3.10 support.

Full CI output is below:
Run xvfb-run --auto-servernum coverage run --source=selex -m unittest discover
......../opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:70: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:70: DeprecationWarning: firefox_binary has been deprecated, please pass in a Service object
  super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:70: DeprecationWarning: firefox_profile has been deprecated, please pass in an Options object
  super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:70: DeprecationWarning: service_log_path has been deprecated, please pass in a Service object
  super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:70: DeprecationWarning: service_args has been deprecated, please pass in a Service object
  super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py:158: DeprecationWarning: firefox_profile has been deprecated, please use an Options object
  firefox_profile = FirefoxProfile(firefox_profile)
E/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/unittest/suite.py:176: ResourceWarning: unclosed file <_io.BufferedWriter name='/dev/null'>
  self._createClassOrModuleLevelException(result, e,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
EEEE/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/unittest/case.py:614: ResourceWarning: unclosed file <_io.BufferedWriter name='/dev/null'>
  outcome.errors.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
EEE.................................s.....
======================================================================
ERROR: setUpClass (tests.unit.test_find_ancestor.ElemFindAncestorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/unit/test_find_ancestor.py", line 27, in setUpClass
    super().setUpClass()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 40, in setUpClass
    cls.driver, cls.elem = test_setup()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 30, in test_setup
    driver = Driver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

======================================================================
ERROR: setUpClass (tests.unit.test_find_elements_by_text.DriverFindElementsByTextTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/unit/test_find_elements_by_text.py", line 57, in setUpClass
    super().setUpClass()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 40, in setUpClass
    cls.driver, cls.elem = test_setup()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 30, in test_setup
    driver = Driver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

======================================================================
ERROR: setUpClass (tests.unit.test_find_elements_by_text.ElemFindElementsByTextTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/unit/test_find_elements_by_text.py", line 89, in setUpClass
    super().setUpClass()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 40, in setUpClass
    cls.driver, cls.elem = test_setup()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 30, in test_setup
    driver = Driver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

======================================================================
ERROR: setUpClass (tests.unit.test_implicit_wait.DriverImplicitWaitFactoryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 40, in setUpClass
    cls.driver, cls.elem = test_setup()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 30, in test_setup
    driver = Driver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

======================================================================
ERROR: test_decorator (tests.unit.test_implicit_wait.DriverImplicitWaitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/unit/test_implicit_wait.py", line 45, in test_decorator
    driver = self.TestDriver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

======================================================================
ERROR: setUpClass (tests.unit.test_keypress.KeypressTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 40, in setUpClass
    cls.driver, cls.elem = test_setup()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 30, in test_setup
    driver = Driver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

======================================================================
ERROR: setUpClass (tests.unit.test_save_as_png.ElemSaveAsPngTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/unit/test_save_as_png.py", line 31, in setUpClass
    super().setUpClass()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 40, in setUpClass
    cls.driver, cls.elem = test_setup()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 30, in test_setup
    driver = Driver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

======================================================================
ERROR: setUpClass (tests.unit.test_typing.TypingTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 40, in setUpClass
    cls.driver, cls.elem = test_setup()
  File "/home/runner/work/selenium-extended/selenium-extended/tests/setup.py", line 30, in test_setup
    driver = Driver("Chrome")
  File "/home/runner/work/selenium-extended/selenium-extended/selex/driver.py", line 37, in __init__
    getattr(webdriver, browser).__init__(self, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    firefox_profile = FirefoxProfile(firefox_profile)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/selenium/webdriver/firefox/firefox_profile.py", line 74, in __init__
    shutil.copytree(self.profile_dir, newprof,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/shutil.py", line 564, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: 'chrome'

----------------------------------------------------------------------
Ran 48 tests in 0.553s

FAILED (errors=8, skipped=1)
call('wmic datafile where name="C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe" get Version /value', shell=True)
[call('wmic datafile where name="C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe" get Version /value', shell=True),
 call('wmic datafile where name="C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe" get Version /value', shell=True)]
Error: Process completed with exit code 1.

Tests fixed in the commit above. All passing now.

Python 3.10 CI workflow added in commit above. All tasks are completed now.


Add Chinese String

I like this app.  Hope it supports localization.💪💪

I hope to incorporate Chinese support in the release as soon as possible. I am from China and I also like this program very much.  Thank you for your work.😁


Nested slots

My use case needs elements included from light dom, is it possible to pass nested slots in such as:
index.html
<my-app>

</my-app>

my-app.html
<page-one></page-one>
<page-two><slot name="title" slot="title"></slot></page-two>

100%, just like this: https://stackblitz.com/edit/nested-slots?file=index.ts
Good luck with the rest of your project!

@Westbrook Perfect.  Thanks for the fast and helpful response.

Can you avoid giving it a name when nesting a slot ?


Replace itsdangerous with authlib for JWS

@svintit - I broke this into a new MR based on @bensta's original branch, since I obviously can't contribute directly to his branch. This PR is his original commit with your feedback applied. Hopefully this carries the changes across the finish line. 😄
Note: I also fixed a relative import statement in the tests and updated the dependencies to their latest minor versions.

@svintit is this ready to be merged? Thanks

This looks good to me, nice work! I'll work on a deploying a new version now and will update here once it's done.

All done, 1.4.5 is released - https://pypi.org/project/flask-oidc-ext/.
Had some issues with Travis CI, so moved away from it.


Mobile Safari 14.1 is unable to negotiate peer connection

Summary
Safari 14.1, on both macOS (observed since 11.3.1) and iOS (since 14.5), fail to negotiate a peer connection, when another peer joins the room, i.e. when Safari is the polite negotiator.
This was not a problem with the previous Safari version (14.0.3 on iOS 14.4.2).
(In an earlier report, I could only reproduce this with Mobile Safari, but not with Desktop Safari. This has now changed, and I can reliably reproduce this issue with a Desktop Safari as well. Of course, I didn't change anything on my system...)
Steps to reproduce

Start the web application.
Use a Mobile Safari 14.1 and create a room

copy the URL/UUID from the Rails log

Using Mobile Safari, tap on "Enter".

you should see your camera picture

Use any other (desktop) browser and visit the same room.
Using the other browser, click "Enter".

you should see your camera picture

After a few seconds, Mobile Safari logs "Negotiation failed after 11 retries".

(N.B. there's an off-by-one error, the RETRY_LIMIT is 10 ;-))

I've managed to reproduce this using XCode/Simulator v12.5 (961.1), albeit not as reliable as with an actual iPhone (I get connection errors all over the place, because I currently have only access to a Late 2013 MBP, which seems to not have quite enough resource to simulate an iPhone accessing a camera + running Safari Devtools in the background).
Details
The console log is produced in setDescription() in webrtc_negotiation.js:
https://github.com/domchristie/webrtc-hotwire-rails/blob/39c69e2df62aee94beb0460481c67d4ea85461bc/app/assets/javascripts/models/webrtc_negotiation.js#L30-L44
The actual error is InvalidStateError: Description type incompatible with current signalling state and is thrown while waiting for the this.peerConnection.setRemoteDescription():
https://github.com/domchristie/webrtc-hotwire-rails/blob/39c69e2df62aee94beb0460481c67d4ea85461bc/app/assets/javascripts/models/webrtc_negotiation.js#L62-L67
peerConnection.signalingState is have-local-offer at that time.
Additional information
The Safari release notes state near the end:

Changes in this release of Safari were included in the following Safari Technology Preview releases: 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122.

However, glancing over the TP release notes, nothing stands out to be an obvious cause for the negotiation to fail.

There's one change in their web-platform-tests suite (https://trac.webkit.org/changeset/266511/webkit/#file4, for TP 114), which strikes me as relevant, as it now contains the newly surfaced error message:
# trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https-expected.txt
13c
- FAIL restartIce() survives rollback promise_test: Unhandled rejection with value: object "TypeError: pc1.restartIce is not a function. (In 'pc1.restartIce()', 'pc1.restartIce' is undefined)"
+ FAIL restartIce() survives rollback promise_test: Unhandled rejection with value: object "InvalidStateError: Description type incompatible with current signaling state"

For cross-reference, I've added a comment to issue 174656 (" RTCPeerConnection rollback rejects with InvalidStateError") on the Wekit BugZilla.

(Desktop Safari is now also affected. I've updated the issue description).

Thanks @dmke for your detailed issue! I don't currently have those versions of Safari, but if you do find a fix, I'd be happy to accept a PR. Thanks again!

Together with @corny, I've cobbled something together here: https://github.com/digineo/webrtc-hotwire-rails
We're still experimenting with it, but so far it looks like just ignoring the InvalidStateError and returning from setDescription() (i.e. skipping the manual rollback) seems to do the trick.
I'll keep you posted.

I have tried the master branch on Safari Version 14.1 (146<IP_ADDRESS>.7) (macOS 10.14.16) connecting to an iPhone running iOS 14.6 and it seemed to work as expected, so I'm wondering if it's an intermittent thing, or an issue with a specific macOS version. (I've experienced some weird media-related issues which should be supported on Safari 14.1 but don't seem to work on macOS 10.14.16 running Safari 14.1 🤷♂)

I stand corrected: I've managed to reproduce this but it's pretty intermittent (~1/25?)

… and it's definitely more frequent when testing locally!
I've attempted a fix in https://github.com/domchristie/webrtc-hotwire-rails/commit/b0a8dab6a60957c0c926df6a4ed23cf985791c5f which, in essence, is similar to your fix, but does not ignore the error. Instead it checks if the client is polite and if the description collides, and if so, only restarts the local negotiation, rather than the negotiations on both the local and remote. If it's impolite or there is no collision, both clients are restarted, with the remote client delaying its restart by 100ms, which seemed a bit more reliable!
I'll add the ice restarts in another commit.
Thanks for raising this!

I've attempted a fix in b0a8dab which, in essence, is similar to your fix, but does not ignore the error. Instead it checks if the client is polite and if the description collides, and if so, only restarts the local negotiation, rather than the negotiations on both the local and remote.

Scrap that, I think this could lead to ice candidate issues. Reverting that part for now.

After further investigation, it looks like attempting to start streaming whenever a candidate/description was received was causing a weird race condition.
I'd still like to figure out why , but I think I've fixed it in https://github.com/domchristie/webrtc-hotwire-rails/commit/88de78d8c8602631fcea88a0e0dfc173d683882f. This new approach only starts streaming when the clients are connected. I hope that helps! :)


Thank you <3 (not an issiue (sorry for abusing this, i know its for reall issiues))

I tried hours to get http://www.lakka.tv/ on my BananaPi Pro
This dd commandline thing never worked and I serached houers for a solution...
Then i found etcher and it was just done... !
This tool is so amazing!
I try to suggest you as default solution for flashig on LakkaTV

Hey there @alugarius ,
Thank you very much for your words! We're very happy to hear we helped you out, and we're very honoured that you recommended us as the default tool on LakkaTV, very appreciated!
I'm closing this issue now, but I encourage you to join our Gitter channel (https://gitter.im/resin-io/chat), where you can say hello to other members of the Etcher community, and to the Etcher team itself!
Have an awesome day!


auto load user uploaded logo and set logo title in site params

load logo from static/images dir if it exists, I'm not familiar with hugo, and realy confuesed with how the sting concatenation is done, hop others know how to complete this feature.

If you install the theme the recommended way (https://mcshelby.github.io/hugo-theme-relearn/basics/installation/#install-the-theme), then you will provide your own logo.html partial.
See https://mcshelby.github.io/hugo-theme-relearn/basics/customization/ for an explaination of the partials and https://gohugo.io/templates/lookup-order/ for a general understanding how this works.
As you can see, the logo.html of your change is inside of the exampleSite and therefore not part of the theme but the theme`s documentation.
I currently do not plan to provide a general way of configuring your logo for the header, as it is (in my eyes) very specific to each installation. But proof me wrong if you have a good solution for it.

you are right, it should not be done this way, this logo detection didn't make it simpler  to config the logo, and logo.html is more fit with the common sense.


Add reneg-sec param as a modifiable attribute in chef.

Hey! So we've been trying to implement 2fa using openvpn and one critical setting for us is the reneg-sec which sets the timeout timer for connections. Currently it's set at 8 hours but I think it would be nice to make this a configurable attribute.

@Darkdoughnut if you create a PR which implements this, we can certainly review it and get it merged in!


HttpSensorAsync always uses default connection ID

Describe the bug
HttpSensorAsync always uses the default connection ID.
To Reproduce
Steps to reproduce the behavior:

Use astronomer.providers.http.sensors.http import HttpSensorAsync
Set a connection ID other than default as parameter

sense = HttpSensorAsync(
    task_id="sense",
    http_conn_id="some_connection_id",
    endpoint=endpoint,
    poke_interval=60, # 1 Minute
    timeout=60 * 60 * 24 * 7,
)

Look at the triggerer's logfile:

{triggerer_job.py:359} INFO - Trigger <astronomer.providers.http.triggers.http.HttpTrigger endpoint=kv/LOCATION_statistics_call_logs_2022-11-14.csv, data={}, headers={}, extra_options={}, http_conn_id=http_default, poke_interval=60> (ID 481) starting

Expected behavior
http_conn_id=some_connection_id

Desktop (please complete the following information):

OS: Linux
astronomer-providers==1.15.0
airflow: 2.5.1
Python 3.10

Additional context
This appears to fix it for me:
    def execute(self, context: Context) -> None:
        """
        Logic that the sensor uses to correctly identify which trigger to
        execute, and defer execution as expected.
        """
        # TODO: We can't currently serialize arbitrary function
        # Maybe we set method_name as users function??? to run it again
        # and evaluate the response.
        if self.response_check:
            self.log.warning("Since response_check param is passed, using the sync version of the sensor.")
            super().execute(context=context)
        else:
            self.defer(
                timeout=timedelta(seconds=self.timeout),
                trigger=HttpTrigger(
                    method=self.hook.method,  # TODO: Fix this to directly get method from ctor
                    http_conn_id=self.http_conn_id,
                    endpoint=self.endpoint,
                    data=self.request_params,
                    headers=self.headers,
                    extra_options=self.extra_options,
                    poke_interval=self.poke_interval,
                ),
                method_name="execute_complete",
            )

correct, thanks for raising it.


Support episode change if page doesn't reload

This PR mostly focusses on re-attaching to a video once the used video is removed from the DOM while keeping the same sessionID (while also fixing some other minor stuff). This allows users to keep their session throughout multiple episodes on Netflix and other SPAs. Page reloads are not supported yet.
Refers #21

Works on Disney+ as well now, so this actually resolves #21


fix: Move detect-secrets pre commit hook out of lint-staged

The type of this PR is: Bugfix

This PR resolves []
Description
Lint-staged apparently prevents detect-secrets from updating .secrets.baseline. This PR moves the command directly into the pre-commit
PR Checklist (tick all before merging)

[x] I have included screenshots or videos to illustrate my changes, or I have not changed anything that impacts the UI.
[x] I have tested my changes on iOS and Android.
[x] I have added tests for my changes, or my changes don't require testing, or I have included a link to a separate Jira ticket covering the tests.
[x] I have added a feature flag, or my changes don't require a feature flag. (How do I add one?)
[x] I have documented any follow-up work that this PR will require, or it does not require any.
[x] I have added an app state migration, or my changes do not require one. (What are migrations?)
[x] I have added a changelog entry below or my changes do not require one.

Changelog updates
Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

Warnings

:warning:

❌ An error occurred while validating your changelog, please make sure you provided a valid changelog.

  Generated by :no_entry_sign: dangerJS against 0266c6bbd848a6cd079256430787238cc8ff9d43


Fix logout handling - transition to a new naming scheme on registered OAuth2 application in Auth0

This closes #447.
Previously we were using a <clustername> format for the name of the Auth0 registered OAuth2 application, but the logout action assumed a <hubname> format. It seems we have consensus on opting for a <clustername>-<hubname> format at this point so this PR is about transitioning to that.
Action points pre-merge

[ ] Decide on the new format clutsername-hubname
[ ] Alternatively, decide it is preferable with more explicit configuration.
I imagine an option to assuming a clusternane-hubname pattern, that a more explicit config option mentioning the Auth0 registered OAuth2 application name could be less magic and make it more clear what's going on.hubs:
  - name: staging
    domain: staging.carbonplan.2i2c.cloud
    template: daskhub
    auth0:
      connection: github
      application_name: carbonplan-staging

[x] Ensure we reference the new OAuth2 application also on /hub/logout
[ ] Ensure we reference the new OAuth2 application format on /hub/login
[ ] Ensure we don't run into issues based on the logic discussed here: https://github.com/2i2c-org/pilot-hubs/pull/448#discussion_r644910435
[ ] In Auth0: register new OAuth2 applications following the new format for all hubs we have

Action points post-merge

[ ] Verify successful deployment, what needs testing is the login and logout action
[ ] In Auth0: delete the old OAuth2 applications following the old format for all hubs we have

I updated the PR description. A decision needs to be made, and then the implementation can follow.

https://auth0.com/docs/api/management/v2#!/Clients/post_clients has a bunch of other options we can set for each client. Maybe we can allow setting name and description under auth0, with name defaulting to <clustername>-<hubname>?

Maybe we can allow setting name and description under auth0, with name defaulting to -?

Would this be a benefit? I figure being explicit can help readability and reduce implementation logic's complexity, allowing for both would increase the complexity from either option.

Would this be a benefit?

Right, I think it's ok to not allow name to be overrideable. Description being overrideable might be useful (it's shown in the login screen) though. Not necessary for this PR!

Right, I think it's ok to not allow name to be overrideable. Description being overrideable might be useful (it's shown in the login screen) though. Not necessary for this PR!

Oh I think i misunderstood you entirely, okay yes sure I get what you are saying now.
What do you suggest? Default to clustername-hubname, not let that be configurable explicitly, but in the future let description etc be configurable?
What do you think about instead of having a magic default that must be documented somewhere, we have config like this now that can be extended in the future?
hubs:
  - name: staging
    domain: staging.carbonplan.2i2c.cloud
    template: daskhub
    auth0:
      connection: github
      application_name: carbonplan-staging
      # application_description: bla bla

Or wait? Is the auth0 application created automatically? I created one manually. If it is created automatically, I'm more inclined to appreciate a naming scheme being assumed.

What do you suggest? Default to clustername-hubname, not let that be configurable explicitly, but in the future let description etc be configurable?

Way to go in this PR, I think.

Or wait? Is the auth0 application created automatically? I created one manually. If it is created automatically, I'm more inclined to appreciate a naming scheme being assumed.

It is created automatically! And maintained automatically - see https://github.com/2i2c-org/pilot-hubs/blob/master/deployer/auth.py. If you delete the on you created manually and run the deployer, it should auto-create it. Auto-creation is why  I'm suggesting the magic name :)

Auto-creation is why I'm suggesting the magic name :)

I agree with the magic name as well ;-)

Ensure we reference the new OAuth2 application format on /hub/login

I still guess we will have a /hub/login failure so I don't want to merge before checking for that. I need to do some errands now but I'll come back to this.

I guess we will have a /hub/login vs /hub/logout discrepancy with regards to what oauth2 applications we use, so I don't want to merge before checking for that.

Can you tell me what you mean by this? I'm not sure I understand

I guess we will have a /hub/login vs /hub/logout discrepancy with regards to what oauth2 applications we use, so I don't want to merge before checking for that.

Can you tell me what you mean by this? I'm not sure I understand

Hmmm... Well I tried following up in the code, but failed to see what I expected.
I believed that there was evidence that my hub had consumed two different Oauth2 applications, something i recall based on inspecting client_id in requests made if i recall correctly. To me, that was an indication that updating the logic only at one place would only change one oauth2 client being used or similarly.
I think I got the evidence to support that understanding wrong somehow.

I still don't feel comfortable merging this myself as I don't understand the deployment sequence. What needs to be done if a deployment fails in the sequence of updates made etc? Perhaps we can do this together tomorrow?


Update avalanche-types + other deps

ref. https://github.com/ava-labs/timestampvm-rs/pull/172

closed via #179


Use EHLO after smtplib.SMTP_SSL too.

After smtplib.SMTP_SSL EHLO should be used.
Ticket: https://code.djangoproject.com/ticket/26487

As noted on the ticket, I wonder of those calls to ehlo() are needed  anymore?. Perhaps Python's behavior has changed since Django 1.0 where the calls were added (7a84ad93e69faf7a14342ebb4da1f6be265f1fe0).
It looks to me like ehlo_or_helo_if_needed() may take care of it (it's new in Python 2.6) and the docs for ehlo() say, "Unless you wish to use has_extn() before sending mail, it should not be necessary to call this method explicitly. It will be implicitly called by sendmail() when necessary."
https://docs.python.org/2/library/smtplib.html#smtplib.SMTP.ehlo
If the calls are needed, it would be great to have some tests for them (currently no tests are failing if the calls to ehlo() are removed).

Closing due to lack of response (and tests).