finding attack vector of CrossReentrancy is very Time-consuming

Hi,
//SPDX-License-Identifier: MIT

pragma solidity ^0.4.0;
contract CrossReentrancy {

    // INSECURE
    mapping (address => uint) private userBalances;

    function transfer(address to, uint amount) public {
        if (userBalances[msg.sender] >= amount) {
            userBalances[to] += amount;
            userBalances[msg.sender] -= amount;
        }
    }

    function withdrawBalance() public {
        uint amountToWithdraw = userBalances[msg.sender];
        // <yes> <report> REENTRANCY
        (bool success, ) = msg.sender.call.value(amountToWithdraw)(""); // At this point, the caller's code is executed, and can call transfer()
        require(success);
        userBalances[msg.sender] = 0;
    }

    function deposit() public payable{
        userBalances[msg.sender]+=msg.value;
    }
}

myth version 0.42 (last version)

It seems pretty fast for me. How long did it take?

about 1 hour

which version did you use?

I test it again on another system, it's take around 20 min.

I test it again on another system, it takes around 20 min.

Oh! it takes around 40 seconds in my system, are you sure that's the contract?

yes, I'm sure. I check it on both

I also remove all packages and install them again.

at now, after 20 min
print
==== External Call To User-Supplied Address ====
SWC ID: 107
Severity: Low
Contract: CrossReentrancy
Function name: withdrawBalance()
PC address: 316
Estimated Gas Usage: 6940 - 61601
A call to a user-supplied address is executed.
An external message call to an address specified by the caller is executed. Note that the callee account might contain arbitrary code and could re-enter any function within this contract. Reentering the contract in an intermediate state may lead to unexpected behaviour. Make sure that no state modifications are executed after this call and/or reentrancy guards are in place.
In file: 1.reentrancy.{cross-function}.CrossReentrancy.sol:19
lue(amountToWithdraw)(""); // At this point

Initial State:
Account: [CREATOR], balance: 0x21c10c00020fbfbd, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x3, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , value: 0x0
Caller: [ATTACKER], function: transfer(address,uint256), txdata: 0xa9059cbb, value: 0x0
Caller: [ATTACKER], function: withdrawBalance(), txdata: 0x5fd8c710, value: 0x0
==== State access after external call ====
SWC ID: 107
Severity: Medium
Contract: CrossReentrancy
Function name: withdrawBalance()
PC address: 401
Estimated Gas Usage: 6940 - 61601
Write to persistent state following external call
The contract account state is accessed after an external call to a user defined address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state.
In file: 1.reentrancy.{cross-function}.CrossReentrancy.sol:21
der] = 0;
}
functio

Initial State:
Account: [CREATOR], balance: 0x7aef9, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x40, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , value: 0x0
Caller: [ATTACKER], function: withdrawBalance(), txdata: 0x5fd8c710, value: 0x0

maybe my python has a problem.
I close this issue.
ref: https://mythril-classic.readthedocs.io/en/master/installation.html

The source mapping is incorrect, can you label your OS and python versions?

Description:	Ubuntu 20.04.4 LTS
Python 3.8.10
I solve it via the command below:

sudo apt install python-is-python3
alias python='python3

problem is not solve, I test version 42,41,39,38

@BuggerBag can you post your pip3 freeze output?

Hi, Here is:
apturl==0.5.2
asn1crypto==1.5.1
attrs==21.4.0
bcrypt==3.1.7
bitarray==1.2.2
blake2b-py==0.1.4
blinker==1.4
Brlapi==0.7.0
cached-property==1.5.2
certifi==2021.10.8
cffi==1.15.0
cfgv==3.3.1
chardet==3.0.4
Click==7.0
coincurve==17.0.0
colorama==0.4.3
coloredlogs==15.0.1
command-not-found==0.3
configparser==5.2.0
coverage==6.3.2
cryptography==2.8
crytic-compile==0.2.2
cupshelpers==1.0
cycler==0.11.0
cytoolz==0.11.2
dbus-python==1.2.16
defer==1.0.6
dictionaries==0.0.2
distlib==0.3.4
distro==1.4.0
distro-info===0.23ubuntu1
duplicity==<IP_ADDRESS>
entrypoints==0.3
eth-abi==2.1.1
eth-account==0.5.7
eth-bloom==1.0.4
eth-hash==0.3.2
eth-keyfile==0.5.1
eth-keys==0.3.4
eth-rlp==0.2.1
eth-typing==2.3.0
eth-utils==1.10.0
ethereum-input-decoder==0.2.2
fasteners==0.14.1
filelock==3.6.0
fonttools==4.31.2
future==0.18.2
hexbytes==0.2.2
httplib2==0.14.0
humanfriendly==10.0
identify==2.4.12
idna==2.8
iniconfig==1.1.1
Jinja2==3.1.0
keyring==18.0.1
kiwisolver==1.4.0
language-selector==0.1
launchpadlib==1.10.13
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
lockfile==0.12.2
louis==3.12.0
lru-dict==1.1.7
macaroonbakery==1.3.1
Mako==1.1.0
MarkupSafe==2.0.1
matplotlib==3.5.1
mock==4.0.3
monotonic==1.5
mypy-extensions==0.4.3
mythril==0.22.42
netifaces==0.10.4
nodeenv==1.6.0
numpy==1.22.3
oauthlib==3.1.0
olefile==0.46
packaging==21.3
paramiko==2.6.0
parsimonious==0.8.1
persistent==4.9.0
pexpect==4.6.0
Pillow==7.0.0
platformdirs==2.5.1
pluggy==1.0.0
pre-commit==2.17.0
prettytable==3.2.0
protobuf==3.6.1
py==1.11.0
py-ecc==4.1.0
py-evm==0.5.0a1
py-flags==1.1.4
py-solc==3.2.0
py-solc-x==1.1.1
pycairo==1.16.2
pycparser==2.21
pycryptodome==3.14.1
pycups==1.9.73
pyethash==0.1.27
PyGObject==3.36.0
PyJWT==1.7.1
pymacaroons==0.13.0
PyNaCl==1.3.0
pyparsing==2.4.7
pyRFC3339==1.1
pysha3==1.0.2
pytest==7.1.1
pytest-cov==3.0.0
pytest-mock==3.7.0
python-apt==2.0.0+ubuntu<IP_ADDRESS>
python-dateutil==2.7.3
python-debian===0.1.36ubuntu1
pytz==2019.3
pyxdg==0.26
PyYAML==5.3.1
reportlab==3.5.34
requests==2.22.0
requests-unixsocket==0.2.0
rlp==2.0.1
SecretStorage==2.3.1
semantic-version==2.9.0
simplejson==3.16.0
six==1.14.0
slither-analyzer==0.8.2
solc-select==0.2.1
sortedcontainers==2.4.0
systemd-python==234
toml==0.10.2
tomli==2.0.1
toolz==0.11.2
transaction==3.0.1
trie==2.0.0a5
typing-extensions==<IP_ADDRESS>
ubuntu-advantage-tools==27.6
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
urllib3==1.25.8
usb-creator==0.3.7
virtualenv==20.13.4
wadllib==1.3.3
wcwidth==0.2.5
xkit==0.0.0
z3-solver==<IP_ADDRESS>
zope.interface==5.4.0

Hi, did you find the bugs or something else in the packages?

Hi, I checked all requirements and I installed all of them. but I don't know why this problem happened.
which packages you are installing? can you print out pip freeze and send me.

can I install Mythril on my windows? in ubuntu the output string is messy!
I also upgrade all my python packages. please send me requirements.txt that Mythril on your ubuntu system runs correctly. thanks in advance.

Ignore the packages that are not in the requirements.
appdirs==1.4.4
asn1crypto==1.3.0
astroid==2.9.1
atomicwrites==1.4.0
attrdict==2.0.1
attrs==19.3.0
bitarray==1.2.2
black==21.12b0
blake2b-py==0.1.3
boto3==1.9.69
botocore==1.12.253
cached-property==1.5.1
cachetools==4.2.4
certifi==2020.6.20
cffi==1.14.0
cfgv==3.1.0
chardet==3.0.4
clang==11.0
click==7.1.2
codecov==2.1.9
coincurve==13.0.0
coloredlogs==10.0
configparser==5.0.0
coverage==6.2
cycler==0.10.0
Cython==0.29.26
cytoolz==0.10.1
dictionaries==0.0.2
distlib==0.3.1
docopt==0.6.2
docutils==0.15.2
eth-abi==2.1.1
eth-account==0.5.6
eth-bloom==1.0.4
eth-hash==0.3.1
eth-keyfile==0.5.1
eth-keys==0.2.4
eth-rlp==0.2.1
eth-tester==0.6.0b4
eth-typing==2.2.1
eth-utils==1.10.0
ethereum-input-decoder==0.2.2
execnet==1.9.0
filelock==3.0.12
flake8==3.5.0
Flask==1.1.0
Flask-Cors==3.0.8
fonttools==4.31.1
future==0.18.2
gitdb==4.0.5
gitdb2==4.0.2
GitPython==3.0.8
google-auth==1.35.0
googleapis-common-protos==1.53.0
hexbytes==0.2.1
htmlmin==0.1.12
huggingface-hub==0.2.1
humanfriendly==8.2
hypothesis==5.36.1
identify==1.4.23
idna==2.7
inflection==0.5.1
iniconfig==1.1.1
instaloader==4.8.2
isort==4.3.4
itsdangerous==1.1.0
Jinja2==2.11.3
jmespath==0.10.0
joblib==1.1.0
jsonschema==3.2.0
kiwisolver==1.2.0
lazy-object-proxy==1.7.1
lru-dict==1.1.6
MarkupSafe==1.1.1
matplotlib==3.5.0b1
mccabe==0.6.1
mock==4.0.2
more-itertools==8.4.0
mypy==0.782
mypy-extensions==0.4.3
myth-concolic-execution==0.0.1
mythril==0.22.42
mythx-models==1.9.3
node-semver==0.8.1
nodeenv==1.4.0
numpy==1.19.0
packaging==20.4
parsimonious==0.8.1
pathspec==0.9.0
pbkdf2==1.3
persistent==4.6.4
pika==1.1.0
Pillow==8.2.0
pipreqs==0.4.11
platformdirs==2.4.1
pluggy==0.13.1
pre-commit==2.6.0
prometheus-client==0.7.0
protobuf==3.17.3
py==1.9.0
py-ecc==1.6.0
py-evm==0.5.0a1
py-flags==1.1.4
py-solc==3.2.0
py-solc-x==1.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.3.1
pycparser==2.20
pycryptodome==3.8.2
pydantic==1.7.3
pyethash==0.1.27
pyflakes==1.6.0
PyJWT==1.7.1
pylint==2.12.2
pymongo==3.9.0
pyparsing==2.4.7
pyrsistent==0.16.0
pysha3==1.0.2
pytest==6.2.5
pytest-cov==3.0.0
pytest-env==0.6.2
pytest-forked==1.3.0
pytest-mock==3.2.0
pytest-sugar==0.9.2
pytest-xdist==2.4.0
python-dateutil==2.8.1
pythx==1.6.2
pytz==2021.3
PyYAML==5.1.1
redis==3.3.11
regex==2020.7.14
repoze.lru==0.7
requests==2.25.0
rlp==2.0.1
rsa==4.7.2
s3transfer==0.1.13
sacremoses==0.0.46
scrypt==0.8.15
semantic-version==2.8.5
semver==2.13.0
simplejson==3.16.0
six==1.15.0
smmap==3.0.4
sortedcontainers==2.2.2
swc-registry==0.0.2
tabulate==0.8.7
termcolor==1.1.0
tokenizers==0.10.3
toml==0.10.1
tomli==1.2.3
toolz==0.10.0
tox==3.23.1
tqdm==4.62.3
transaction==3.0.0
transformers==4.15.0
trie==2.0.0a5
typed-ast==1.4.1
types-requests==2.26.0
typing-extensions==<IP_ADDRESS>
urllib3==1.24.3
virtualenv==20.0.27
wcwidth==0.2.5
Werkzeug==1.0.1
wrapt==1.13.3
yarg==0.1.9
z3-solver==<IP_ADDRESS>
zope.interface==5.1.0

Hi, my friend thank you very much, I will test soon.
I'm busy as a bee. :)

Hi, what is myth-concolic-execution==0.0.1 ?
This package rise an error.

You can ignore those! Just focus on the ones in requirements.txt

output:
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: blake2b-py in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 1)) (0.1.3)
Requirement already satisfied: coloredlogs>=10.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 2)) (10.0)
Requirement already satisfied: coincurve>=13.0.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 3)) (13.0.0)
Requirement already satisfied: asn1crypto>=0.22.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 4)) (1.3.0)
Requirement already satisfied: configparser>=3.5.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 5)) (5.0.0)
Requirement already satisfied: coverage>6.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 6)) (6.2)
Requirement already satisfied: py_ecc<5.0.0,>=1.4.7 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 7)) (1.6.0)
Requirement already satisfied: eth_abi<3.0.0,>=2.0.0b4 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 8)) (2.1.1)
Requirement already satisfied: eth-account<0.6.0,>=0.5.6 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 9)) (0.5.6)
Requirement already satisfied: ethereum-input-decoder>=0.2.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 10)) (0.2.2)
Requirement already satisfied: eth-hash>=0.3.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 11)) (0.3.1)
Requirement already satisfied: eth-keyfile<0.6.0,>=0.5.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 12)) (0.5.1)
Requirement already satisfied: eth-keys<0.4.0,>=0.2.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 13)) (0.2.4)
Requirement already satisfied: eth-rlp<0.3.0,>=0.1.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 14)) (0.2.1)
Requirement already satisfied: eth-typing<3.0.0,>=2.1.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 15)) (2.2.1)
Requirement already satisfied: eth-utils<2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 16)) (1.10.0)
Requirement already satisfied: jinja2>=2.9 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 17)) (2.11.3)
Requirement already satisfied: MarkupSafe<2.1.0 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 18)) (1.1.1)
Requirement already satisfied: mock in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 19)) (4.0.2)
Requirement already satisfied: persistent>=4.2.0 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 20)) (4.6.4)
Requirement already satisfied: py-flags in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 21)) (1.1.4)
Requirement already satisfied: py-evm==0.5.0a1 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 22)) (0.5.0a1)
Requirement already satisfied: pysha3 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 23)) (1.0.2)
Requirement already satisfied: py-solc-x in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 24)) (1.0.0)
Requirement already satisfied: py-solc in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 25)) (3.2.0)
Requirement already satisfied: pytest>=3.6.0 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 26)) (6.2.5)
Requirement already satisfied: pyparsing<3,>=2.0.2 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 27)) (2.4.7)
Requirement already satisfied: pytest-cov in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 28)) (3.0.0)
Requirement already satisfied: pytest_mock in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 29)) (3.2.0)
Requirement already satisfied: requests in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 30)) (2.25.0)
Requirement already satisfied: rlp<3 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 31)) (2.0.1)
Requirement already satisfied: semantic_version in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 32)) (2.8.5)
Requirement already satisfied: transaction>=2.2.1 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 33)) (3.0.0)
Requirement already satisfied: typing-extensions<4,>=3.7.4 in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 34)) (<IP_ADDRESS>)
Requirement already satisfied: z3-solver>=<IP_ADDRESS> in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 35)) (<IP_ADDRESS>)
Requirement already satisfied: matplotlib in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 37)) (3.5.0b1)
Requirement already satisfied: pre-commit in /home/talebi/.local/lib/python3.8/site-packages (from -r requirements.txt (line 38)) (2.6.0)
Requirement already satisfied: certifi>=2020.06.20 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 39)) (2020.6.20)
Requirement already satisfied: lru-dict>=1.1.6 in /home/talebi/.local/lib/python3.8/site-packages (from py-evm==0.5.0a1->-r requirements.txt (line 22)) (1.1.6)
Requirement already satisfied: cached-property<2,>=1.5.1 in /usr/local/lib/python3.8/dist-packages (from py-evm==0.5.0a1->-r requirements.txt (line 22)) (1.5.1)
Requirement already satisfied: mypy-extensions<1.0.0,>=0.4.1 in /home/talebi/.local/lib/python3.8/site-packages (from py-evm==0.5.0a1->-r requirements.txt (line 22)) (0.4.3)
Requirement already satisfied: pyethash<1.0.0,>=0.1.27 in /home/talebi/.local/lib/python3.8/site-packages (from py-evm==0.5.0a1->-r requirements.txt (line 22)) (0.1.27)
Requirement already satisfied: trie==2.0.0-alpha.5 in /home/talebi/.local/lib/python3.8/site-packages (from py-evm==0.5.0a1->-r requirements.txt (line 22)) (2.0.0a5)
Requirement already satisfied: eth-bloom<2.0.0,>=1.0.3 in /usr/local/lib/python3.8/dist-packages (from py-evm==0.5.0a1->-r requirements.txt (line 22)) (1.0.4)
Requirement already satisfied: hexbytes<0.3.0,>=0.2.0 in /home/talebi/.local/lib/python3.8/site-packages (from trie==2.0.0-alpha.5->py-evm==0.5.0a1->-r requirements.txt (line 22)) (0.2.1)
Requirement already satisfied: sortedcontainers<3,>=2.1.0 in /home/talebi/.local/lib/python3.8/site-packages (from trie==2.0.0-alpha.5->py-evm==0.5.0a1->-r requirements.txt (line 22)) (2.2.2)
Requirement already satisfied: humanfriendly>=4.7 in /home/talebi/.local/lib/python3.8/site-packages (from coloredlogs>=10.0->-r requirements.txt (line 2)) (8.2)
Requirement already satisfied: cffi>=1.3.0 in /usr/local/lib/python3.8/dist-packages (from coincurve>=13.0.0->-r requirements.txt (line 3)) (1.14.0)
Requirement already satisfied: parsimonious<0.9.0,>=0.8.0 in /home/talebi/.local/lib/python3.8/site-packages (from eth_abi<3.0.0,>=2.0.0b4->-r requirements.txt (line 8)) (0.8.1)
Requirement already satisfied: bitarray<1.3.0,>=1.2.1 in /usr/local/lib/python3.8/dist-packages (from eth-account<0.6.0,>=0.5.6->-r requirements.txt (line 9)) (1.2.2)
Requirement already satisfied: pycryptodome<4.0.0,>=3.4.7 in /home/talebi/.local/lib/python3.8/site-packages (from eth-keyfile<0.6.0,>=0.5.1->-r requirements.txt (line 12)) (3.8.2)
Requirement already satisfied: cytoolz<1.0.0,>=0.9.0 in /usr/local/lib/python3.8/dist-packages (from eth-keyfile<0.6.0,>=0.5.1->-r requirements.txt (line 12)) (0.10.1)
Requirement already satisfied: zope.interface in /home/talebi/.local/lib/python3.8/site-packages (from persistent>=4.2.0->-r requirements.txt (line 20)) (5.1.0)
Requirement already satisfied: dictionaries==0.0.2 in /usr/local/lib/python3.8/dist-packages (from py-flags->-r requirements.txt (line 21)) (0.0.2)
Requirement already satisfied: pluggy<2.0,>=0.12 in /home/talebi/.local/lib/python3.8/site-packages (from pytest>=3.6.0->-r requirements.txt (line 26)) (0.13.1)
Requirement already satisfied: iniconfig in /home/talebi/.local/lib/python3.8/site-packages (from pytest>=3.6.0->-r requirements.txt (line 26)) (1.1.1)
Requirement already satisfied: toml in /home/talebi/.local/lib/python3.8/site-packages (from pytest>=3.6.0->-r requirements.txt (line 26)) (0.10.1)
Requirement already satisfied: py>=1.8.2 in /home/talebi/.local/lib/python3.8/site-packages (from pytest>=3.6.0->-r requirements.txt (line 26)) (1.9.0)
Requirement already satisfied: packaging in /home/talebi/.local/lib/python3.8/site-packages (from pytest>=3.6.0->-r requirements.txt (line 26)) (20.4)
Requirement already satisfied: attrs>=19.2.0 in /usr/local/lib/python3.8/dist-packages (from pytest>=3.6.0->-r requirements.txt (line 26)) (19.3.0)
Requirement already satisfied: idna<3,>=2.5 in /home/talebi/.local/lib/python3.8/site-packages (from requests->-r requirements.txt (line 30)) (2.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/talebi/.local/lib/python3.8/site-packages (from requests->-r requirements.txt (line 30)) (1.24.3)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/lib/python3/dist-packages (from requests->-r requirements.txt (line 30)) (3.0.4)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.8/dist-packages (from matplotlib->-r requirements.txt (line 37)) (4.31.1)
Requirement already satisfied: setuptools-scm>=4 in /home/talebi/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 37)) (6.4.2)
Requirement already satisfied: numpy>=1.17 in /home/talebi/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 37)) (1.19.0)
Requirement already satisfied: pillow>=6.2.0 in /home/talebi/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 37)) (8.2.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/talebi/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 37)) (1.2.0)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.8/dist-packages (from matplotlib->-r requirements.txt (line 37)) (0.10.0)
Requirement already satisfied: python-dateutil>=2.7 in /home/talebi/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 37)) (2.8.1)
Requirement already satisfied: pyyaml>=5.1 in /home/talebi/.local/lib/python3.8/site-packages (from pre-commit->-r requirements.txt (line 38)) (5.1.1)
Requirement already satisfied: identify>=1.0.0 in /home/talebi/.local/lib/python3.8/site-packages (from pre-commit->-r requirements.txt (line 38)) (1.4.23)
Requirement already satisfied: nodeenv>=0.11.1 in /home/talebi/.local/lib/python3.8/site-packages (from pre-commit->-r requirements.txt (line 38)) (1.4.0)
Requirement already satisfied: cfgv>=2.0.0 in /usr/local/lib/python3.8/dist-packages (from pre-commit->-r requirements.txt (line 38)) (3.1.0)
Requirement already satisfied: virtualenv>=20.0.8 in /home/talebi/.local/lib/python3.8/site-packages (from pre-commit->-r requirements.txt (line 38)) (20.0.27)
Requirement already satisfied: pycparser in /home/talebi/.local/lib/python3.8/site-packages (from cffi>=1.3.0->coincurve>=13.0.0->-r requirements.txt (line 3)) (2.20)
Requirement already satisfied: tomli in /home/talebi/.local/lib/python3.8/site-packages (from coverage>6.0->-r requirements.txt (line 6)) (1.2.3)
Requirement already satisfied: six in /home/talebi/.local/lib/python3.8/site-packages (from cycler>=0.10->matplotlib->-r requirements.txt (line 37)) (1.15.0)
Requirement already satisfied: toolz>=0.8.0 in /home/talebi/.local/lib/python3.8/site-packages (from cytoolz<1.0.0,>=0.9.0->eth-keyfile<0.6.0,>=0.5.1->-r requirements.txt (line 12)) (0.10.0)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from setuptools-scm>=4->matplotlib->-r requirements.txt (line 37)) (45.2.0)
Requirement already satisfied: distlib<1,>=0.3.1 in /usr/local/lib/python3.8/dist-packages (from virtualenv>=20.0.8->pre-commit->-r requirements.txt (line 38)) (0.3.1)
Requirement already satisfied: filelock<4,>=3.0.0 in /usr/local/lib/python3.8/dist-packages (from virtualenv>=20.0.8->pre-commit->-r requirements.txt (line 38)) (3.0.12)
Requirement already satisfied: appdirs<2,>=1.4.3 in /usr/local/lib/python3.8/dist-packages (from virtualenv>=20.0.8->pre-commit->-r requirements.txt (line 38)) (1.4.4)
but the problem is not solved!

I check all. but the problem is remaining.
Mythril can find but the printed output is messy.

I use docker, but the problem is remaining also I use a few commands
myth analyze contract.sol > output.txt
myth analyze contract.sol -t 3
myth analyze contract.sol --solv 0.4.24

docker image can find bugs but the output is messy.

You can also run commands in docker, something like
docker run -v $(pwd):/tmp mythril/myth analyze /tmp/contract.sol -t 3

You can pull the image using
docker pull mythril/myth

my friend, in the last post, I told you
"docker image can find bugs but the output is messy."
I tried but the output is messy. I tried three different systems.

For the CrossReentrancy contract can you post the output of this command
myth -v4 a <filename>

in one of my systems, the output is look like this:
mythril.mythril.mythril_config [INFO]: Infura key not provided, so onchain access is disabled.
An external message call to an address specified by the caller is executed. Note that the callee account might contain arbitrary code and could re-enter any function within this contract. Reentering the contract in an intermediate state may lead to unexpected behaviour. Make sure that no state modifications are executed after this call and/or reentrancy guards are in place.
--------------------
In file: cr.sol:19

msg.sender.call.value(amountToWithdraw)("")

--------------------
Initial State:

Account: [CREATOR], balance: 0x21c10c00020fbfbd, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x2, nonce:0, storage:{}

Transaction Sequence:

Caller: [CREATOR], calldata: , value: 0x0
Caller: [ATTACKER], function: transfer(address,uint256), txdata: 0xa9059cbb, value: 0x0
Caller: [ATTACKER], function: withdrawBalance(), txdata: 0x5fd8c710, value: 0x0

==== State access after external call ====
SWC ID: 107
Severity: Medium
Contract: CrossReentrancy
Function name: withdrawBalance()
PC address: 401
Estimated Gas Usage: 6940 - 61601
Write to persistent state following external call
The contract account state is accessed after an external call to a user defined address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state.
--------------------
In file: cr.sol:21

userBalances[msg.sender] = 0

--------------------
Initial State:

Account: [CREATOR], balance: 0x3aff9, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x10000000004, nonce:0, storage:{}

Transaction Sequence:

Caller: [CREATOR], calldata: , value: 0x0
Caller: [ATTACKER], function: withdrawBalance(), txdata: 0x5fd8c710, value: 0x0

in another system, it won't print.
in the third system, the output is messy and shows lances[msg.sender] = 0

Great! the output in the first system is fine. It doesn't seem to take 20 minutes based on the logs. What's the difference between all the three systems?

My firend, the pip freeze showing the same package.
1: dell G3 3500 with ubunto 20.4
2: acer aspire v15 with ubunto 20.4 with same spec as 1st
3: my desktop pc with kali linux (latest version)
today, I test it with my new laptop dell G5, but output is messy, and running with in 20s.
the amazing thing is that pip freeze showing same packages!

@BuggerBag the only way this could be possible is that there could be an OS incompatibility issue with some older packages such as solc-v0.4.26. Can you try a recent contract such as
pragma solidity ^0.8.0;

contract Exceptions {

    uint val;

    function change_val() public {
        val = 1;
    }
    function assert1() public pure {
    	uint256 i = 1;
        assert(i == 0);
    }

    function fail() public view {
        assert(val==2);
    }

}

This is likely a solidity compiler issue with older versions. Can you paste the logs for the third system?

@norhh it can't print any output.
I use this command myth -v4 a <filename>

can you try myth -v5 a <filename>?

hi @norhh, I'm busy, when I'm free, I do that. maybe (5 days)
thank you.

Hi, I solve the problem. the Mythril wasn't installed entirely and a few packages have been broken.

Hi, I solve the problem. the Mythril wasn't installed entirely and a few packages have been broken. :) / thank you @norhh

Same issue here. It takes 15-20 min to analyze for standard ERC20 token. How to find the problem? @BuggerBag @norhh

Hi @emretepedev, This is the expected behavior, as it should take quite some time to run on such contracts. Mythril is a symbolic execution engine, it translates bytecode into SMT queries to check for issues, these SMT queries are usually complex to solve, hence the time.

Hi @emretepedev, This is the expected behavior, as it should take quite some time to run on such contracts. Mythril is a symbolic execution engine, it translates bytecode into SMT queries to check for issues, these SMT queries are usually complex to solve, hence the time.

Thank you for information. I got it. If it is expected behavior, not a problem. I will add mythril to ci/cd definitely :)


Flecs Core Tests

[ ] Component
[x] Entity
[ ] Enum
[ ] Event
[ ] Filter
[ ] FIlterBuilder
[x] Iterable
[x] Observer
[x] Query
[x] QueryBuilder
[ ] Refs
[ ] Singleton
[ ] Table
[ ] Trigger
[x] World
[ ] WorldFactory

outdated, closing


Scaffold component style issue

It looks like the Scaffold component in the Context.tsx has "Scaffold" hard coded on line 160

The development of the original Scaffold component was started more than two years ago in material-ui-umd repo. Right now It definitely overcame it's architecture and It's time to refactor it
In<EMAIL_ADDRESS>I created a Scaffold2 component which got a better user experience. The code is much cleaner, I think It is going to be useful for you to check this MR


Editable property with dynamic date expression gives run-time error

Describe the bug
When date comparison is used as dynamic expression on a Editable property a run-time error occurs.
To Reproduce
Steps and to reproduce the behavior:

Create a page
Add a field with an Editable property based on an expression comparing another date field to 0D
Compile and run

page 50100 "Editable Bug Repro"
{
    PageType = List;
    SourceTable = "Sales Line";

    layout
    {
        area(content)
        {
            repeater(General)
            {
                field("Planned Shipment Date"; "Planned Shipment Date")
                {
                    ApplicationArea = All;
                }
                field("Planned Delivery Date"; "Planned Delivery Date")
                {
                    ApplicationArea = All;
                    Editable = "Planned Shipment Date" = 0D; // This will cause a run-time error
                }
            }
        }
    }
}

Expected behavior
Simple boolean expressions can be used for the Editable property.
Screenshots
The run-time error when opening the page:

5. Versions:

AL Language: 5.271898

Business Central: DK Business Central 16.0 (Platform 16.0.11233.12061 + Application 16.0.12076.0)

Hi! Please take a minute to read the guidelines for this repository https://github.com/microsoft/AL and our collection of frequently asked questions https://github.com/Microsoft/AL/wiki/frequently-Asked-Questions .
As this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.
To open a support case, you can:

Open a support request to CSS through the PartnerSource portal
Contact your Service Account Manager (SAM) in your local subsidiary to understand what is included in your contract as of support incident and PAH (Partner Advisory Hours). Your SAM might also direct you "step by step" how to open a support request or how to get credentials, if this is the first time for you or your company

If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.

@atoader Why would this not qualify as bug for this repository? Is it due to it generating a runtime error and not a compile time error?
Just trying to understand what goes where.

@AskeHolst As I understand it, this repo handles issues of the AL Language extension only, hence issues that may happen until the application is built. This does not cover run-time errors of the application that you have created.

@NKarolak Thank you, that makes some sense.

Thank you, Natalie! You are correct. We are trying to keep the scope of the repository focused so that we can offer value in our area of expertise.
Unfortunately, 50-80% of the issues that hit the repository each day are not related to the tools, and to try to focus on the 20%, we try to close them with the standard reply and guidance on where to post them.


Update autorest version to prerelease 3.0.0-alpha.20240414.4.x

Triggered from pull request: https://github.com/Azure/autorest.csharp/pull/4185

Close in favor of #43872


Device can't connect to server or can't download packages

Device
iPhone 7
Version
iOS 15.8
Passcode?

[X] Passcode is enabled.

Start going into detail..
Device after jailbreak can't access internet, mobile data is active though I can browse internet through iphone's hotspot, but can't use it on my device. I can download package manager like sileo but can't install packages even browsing through safari it says "can't connect to server".

Familiarity with palera1n

[X] I am familiar with palera1n and how to use it!

Familiarity with CLI

[X] I am familiar with the command-line!

If the wifi toggle greyed out? For example not letting you toggle it on?

If the wifi toggle greyed out? For example not letting you toggle it on?

I can toggle wifi and can connect AP's. Wifi is working properly.


fix fourth argument type of accept.language_filter_basic

Fix accept.language_filter_basic function argument type.
The 4th argument type must be INTEGER but defined as STRING so I've changed it.
see doc: https://developer.fastly.com/reference/vcl/functions/content-negotiation/accept-language-filter-basic/

This is just tiny change so I'll merge this


[v1.8.0] Relevancy changes

Motivation
Implementing https://github.com/meilisearch/meilisearch/issues/4484 gives us the ability to finally untie the importance (or weight) of each field with their order.
Usage
Nothing to do.
Changes
When no searchable attributes are declared
When no searchable attributes are declared, all the fields have the same importance instead of randomly giving more importance to the field we've encountered « the most early » in the life of the index.
This means that before this PR, send the following json:
[
  { "id": 0, "name": "kefir", "color": "white" },
  { "id": 1, "name": "white", "last name": "spirit" }
]

Would make the field name more important than the field color or last name.
This means that searching for white would make the document 1 automatically higher ranked than the document 0.
After this PR, all the fields have the same weight, and none are considered more important than others.
When a nested field is made searchable
The second behavior change that happened with this PR is in the case you're sending this document, for example:
{
  "id": 0,
  "name": "tamo",
  "doggo": {
    "name": "kefir",
    "surname": "le kef"
  },
  "catto": "gromez"
}

Previously, defining the searchable attributes as: ["tamo", "doggo", "catto"] was actually defining the « real » searchable attributes in the engine as: ["tamo", "doggo", "catto", "doggo.name", "doggo.surname"], which means that doggo.name and doggo.surname were NOT where the user expected them and had completely different weights than doggo.
In this PR all the weights have been unified, and the « real » searchable fields look like this:
[ "tamo", "doggo", "doggo.name", "doggo.surname", "catto"]
   ^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    ^^^^^
Weight 0                 Weight 1                  Weight 2

Impacted teams

Implemented in https://github.com/meilisearch/meilisearch/pull/4631


Determine whether to scope docs artifacts

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/216
Originally created by @bencodezen on 2018-12-13 21:15:14

Per @mbergeron's suggestion on https://gitlab.com/meltano/meltano/merge_requests/218/, we need to decide whether we want the docs to be built out to the root public directory, or whether we want to use symlinks on this.

View 7 previous comments from the original issue on GitLab


I want a precise understanding of sessions.

I fully understand that one gRPC channel can handle up to 100 sessions.
If a single Google Spanner node can perform 1000 concurrent queries, does this mean that one node is equivalent to 1000 sessions?
Spanner, unlike traditional databases, uses the concept of sessions rather than connections. However, due to similar mechanisms like session pools and connection pools, it's often confusing whether sessions and connections are the same thing. Is a session the same as a connection?

Sessions in Cloud Spanner and connections in traditional relational databases are different, however they do have some similarities. The best way to view it is like this:

A connection in a traditional relational database combines both the physical connection (e.g. TCP connection) between the client and the server, and the session state (e.g. which database am I connected to, am I currently executing a transaction, is the connection in read-only mode, etc.)
Cloud Spanner uses gRPC for communication between the client and the server. For this, gRPC uses 'channels', which are roughly equivalent to TCP connections. One gRPC channel can carry multiple requests (up to 100) at the same time. gRPC channels do not have any 'session state' or anything like that. They are oblivious to what kind of requests are being sent and received.
Cloud Spanner uses sessions to maintain session state (e.g. which database is being used, what role does the current user have), and to execute transactions. One session can have at most one (read/write) transaction at any time.

So as a rule of thumb, you should have as many sessions in your session pool as the number of concurrent transactions that your client will execute in parallel. Note that a transaction in this case in also includes read-only transactions, as the Spanner client will use one session from the pool for each transaction that it executes.
You write that a single Cloud Spanner node can execute 1,000 queries, but that number is incorrect. The correct number is 22,500. See https://cloud.google.com/spanner/docs/performance#increased-throughput. Note that the maximum throughput is in an ideal case, and that in the real world with an application that is executing both reads and writes at the same time, and where not all reads are simple reads selecting a single row using the primary key, the number will be lower.
Sessions are unrelated to the number of Cloud Spanner nodes. You should determine the number of sessions that you need in your client based on what your client will be doing. A couple of extreme examples:

You have a client that is running a simple monitoring job that is polling data single threaded using a query that is executed once a second: This client does not need more than 1 session. (But for simplicity, you can keep the session pool configuration unchanged, as the extra sessions won't hurt performance anywhere)
You have a client that handles incoming web requests, and this client can handle up to 2,000 web requests in parallel. Each web request will also need to execute transactions on Cloud Spanner. These requests also start a second goroutine that also write some log data to Cloud Spanner, meaning that each request will have two goroutines writing to Cloud Spanner at the same time. The theoretical maximum number of parallel transactions that your application can have is 4,000, so you should have 4,000 sessions in your session pool.


Stack and its real life applications

Stack and its real life applications
###Stack implementation using array
###Stack implementation using Linked List
###Multiple Stack
###Parenthesis Checker
###Infix to Postfix
###Infix to Prefix
###Prefix evaluation
###Postfix Evaluation
Write here what you have changed in codebase
#838
Self Check(Tick After Making pull Request)

[ ] This issue was assigned to me if not it will marked as spam.
[x] My file is in proper folder.
[x] I am following clean code and Documentation.
[x] I have added title and what program will do first in the file.

This wasn't assigned to me. But I have a PR lined up.

@dalalvarun Your implementation code is in the wrong directory.


NUMBERS-166: removing BiConsumer implementation from SortInPlace

Coverage remained the same at 99.658% when pulling 437432572b9840ebf7b34efa5e0de35971a38f79 on darkma773r:numbers-166-sortinplace into 4457bfdb65383de0daa9902ad0856f848892f364 on apache:master.


Width=0 After Resizing Window While display:none

I have a panel in which I initiate a slick slider. This panel is initially hidden with display:none.
Because it is hidden, I call the resize() method after the user expands the panel, so the widths can be recalculated. This works fine.
However, if I expand the panel, then collapse it, then resize my browser window, and finally expand the panel again, the slides have width: 0px.
See this jsfiddle: http://jsfiddle.net/6z1Lc245/
Steps are:

expand panel
collapse panel
resize window
expand panel
widths are 0px

Is there a work-around for this behavior?

I would wager to say you might need to call setDimensions on show.

DIdn't seem to do it? http://jsfiddle.net/6z1Lc245/1/
(Plus any code after that line doesn't get executed.)

http://jsfiddle.net/Lp1gaL1e/

@kenwheeler This still seems to be an issue if you have autoplay enabled with fade. After you open, then close, and open again the width is 0, then on next slide it updates to proper width causing a jump. No matter what I do it doesn't update until next slide fades in.
See here: http://jsfiddle.net/p4adf2s9/


v4 - Use "@if not $bool" expression

Seems pretty straightforward to me. I wonder if we need to put parenthesis around the check though. I remember there were some issues in the past.
/CC @mdo

The parenthesis issue has been fixed since libsass 3.1

Then one more reason to merge this as is :+1:

Nice! I meant to go look for the syntax for this and never got around to it. Thanks!


Parlay should add itself as a tool in the SBOM

I'm part of the CISA Tiger Team for SBOM Generation. We've adopted Parlay as part of the reference implementation. It generally speaking works fine, but we're missing one relatively small detail, namely that Parlay should add itself as a tools in the pipeline (metadata.tools in CycloneDX).
We're currently working around this by appending parlay with sbomasm, but it would be great if this wasn't a necessary step.

Hey @vpetersson
there is an old (stale) discussion on this topic here: https://github.com/snyk/parlay/issues/11
There was some pushback on the idea of inserting parlay as a tool into the SBOM as it effectively alters creation data. However, I'm open to reviving this discussion and re-assess whether this isn't complete adequate. As parlay's enrichment insert new data anyawy, why not an additional entry to the tools section of the SBOM?

(@goneall is in fact part of the Tiger Team too for context.)
A fair point is raised in the discussion in #11. From our vantage point however, the generation and the enrichment happens in the same CI/CD workflow. Thus the creation timestamp is less of an issue. If this is more of a manual process, the timestamp might of course be more of an issue.
Perhaps this is a feature that should be enabled by default, but could be disabled with an argument?

In the scenario the SBOM Generation tiger team is using Parlay, adding the tool should be fine since the original SBOM is never really "published".  Where we would get into trouble is if we have 2 SBOMs published with exactly the same namespace URI (similar to the CDX serial number).  Many systems (including some I've written) depend on the namespace being unique.
Could we created a unique SPDX document namespace as part of the Parlay (e.g. append "/parley-enhanced")?  If you want to relate back to the original document, you can add an Amends relationship between the docs.  I can provide an example if this is helpful.

Perhaps this is a feature that should be enabled by default, but could be disabled with an argument?

I was having the same thought, a possibility to opt out of this. Sounds good!

Could we created a unique SPDX document namespace as part of the Parlay (e.g. append "/parley-enhanced")?

you can add an Amends relationship between the docs

I feel like both things are something we'd want regardless of the additional entry to the list of tools. Parlay is changing the original document in other ways depending on what enrichment strategy you chose, this should probably be reflected on the namespace, serial number anyway. Again, we could offer a way to opt out of this if it's not desired.
@goneall an example would be really helpful!

@mcombuechen - I created a pull request in the SPDX examples repo with what I would propose are additional fields for any tool which modifies an SPDX document: https://github.com/spdx/spdx-examples/tree/enrich/software/example14
Let me know if you have any questions.


Algorithms Sorting-2 (Easy)

Solve Insertion Sort - Part 2 and Counting Sort 2

I want to do it in C++

I can do it in Python

Can I take this up in Java?

This issue has all the solution you can close it


Update cni-plugins to v1.6.0

What type of PR is this?
/kind ci
What this PR does / why we need it:
Update CNI plugins to their latest release.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?

None

/approve
/lgtm


fix: using sqlx::test macro inside macro's

Does your PR solve an issue?
fixes #3534
This fixes a regression in the sqlx::test macro, this pr makes it work inside macro's. The error message seems to also have been changed by accident between version 0.7.4 and 0.8.0 so I changed it back.

Wasn't really sure how to write a proper regression test for this, I hope this is sufficient.


 This is a good choice for a general purpose relational database like Postgres, but less good for queue applications.
For small, short transactions (enqueueing and updating job status), synchronous commit quickly dominates queue performance.
By accepting the tradeoff of a small window of time (200ms by default) between writing to the WAL and persisting to permanent storage when data may be lost, an order of magnitude performance gain is realized.
https://www.postgresql.org/docs/current/wal-async-commit.html

Synchronous commit would delay persistence to the WAL right, writes to the disk are still done asynchronously no matter what using the buffer manager?
This also only affects TXNs/Queries for that session right. So other sessions don't need to worry about their data potentially being lost?

Synchronous commit would delay persistence to the WAL right, writes to the disk are still done asynchronously no matter what using the buffer manager?

I'm using https://www.postgresql.org/docs/current/wal-async-commit.html for reference here. My reading of it is that synchronous commit has no bearing on the WAL, but to "persistence to permanent storage".

As described in the previous section, transaction commit is normally synchronous: the server waits for the transaction's WAL records to be flushed to permanent storage before returning a success indication to the client.

This change allows the transaction to appear "committed" to the client as soon as its written to the WAL.

This also only affects TXNs/Queries for that session right. So other sessions don't need to worry about their data potentially being lost?

Right, we're using SET sychronous_commit = 'off' in the connection's AfterConnect rather than setting the same in the postgres server config.


fix: ellipsis for long names on mobile

Task linked: CU-2y41tjx Mobile Header cuts off username


Code Dataset

Hi there, great work!
Do you have plans for code datatset, and if yes when can we expect it?

Hi @mtasic85, thank you for your interest in ProX!
We will try it on code data in the coming days; however, I can't confirm the exact timeline yet. Unlike web and math data, code mainly comes from GitHub, which involves a different approach for downloading, organizing and training.


Optimize DataQueue.average

Since you always call heartRateData.add and then immediately heartRateData.average, I think you should delete the code in DataQueue.average and instead add a new field: average, that is maintained by add and reset and average() only returns it:
add(element) {
var oldestVal = data[pos];
if (oldestVal != null) {
average -= oldestVal;
}
data[pos] = element;
average += element;
pos = (pos + 1) % maxSize;
}

I've integrated this suggestion, thanks 👍


Normalize v4 listings to be viewed in v5 clients

Ok so this code should normalize the v4 contracts pricing components (listing price, shipping options) into the v5 format for viewing in client.

I think this would be better to use UnmarshalJSONSignedListing which should convert the whole thing to v5.

Coverage decreased (-0.03%) to 40.965% when pulling d70179190d3007486dc68b540a22126b855cdf2a on brian.normalize-v4 into c110900e13ec8d621707e9e12d7c03a73da86018 on ethereum-master.

Needs #1906 to be a predecessor here and potentially will render it unnecessary.

We decided to close this until #1906 is resolved. At that point we can decide if this needs to be reconsidered.


refactor: Copy caseworker S2S micro-service key in rd vault

JIRA link (if applicable)
NA
Change description
refactor: Copy caseworker S2S micro-service key in rd vault
Does this PR introduce a breaking change? (check one with "x")
No

As discussed, this PR is not required, we should close this


looking up and storing team info for botkit storage

Slash commands with Botkit don't work if the team isn't stored in the botkit storage.  This PR grabs and stores the team info whenever an add_resource event is sent to a process.

👍


Fix mobile

Always render {{children}} and hide it if mobile is null (I believe that's the conditional rendering issue)
Fix hook dependencies
Refactor nested function components

(The second two are fixes I thought would solve the hook issue, but are good to keep either way)

closing bc i fixed this!


Contracts are not properly covered (code coverage) when they define the same event

Component
Forge
Have you ensured that all of these are up to date?

[X] Foundry
[X] Foundryup

What version of Foundry are you on?
forge 0.2.0 (8d0099b 2023-04-19T00:08:21.764755505Z)
What command(s) is the bug in?
forge coverage
Operating System
Linux
Describe the bug
I have use this small repository used to test forge coverage. Here are my modifications to replicate the bug.
I cornered case the example a bit (the updates are also in the PR):
Let's define 2 new contracts:
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.15;

contract ExtraFileContract1 {
    event ExtraFileEvent(uint256 n);

    function compute(bool increment) external {
        // Should be treated as a branch
        require(increment);

        emit ExtraFileEvent(2);
    }
}

contract ExtraFileContract2 {
    // BUG (?): If we would call this event `ExtraFileEvent(uint256 n)`
    // then the compute function below would not be covered.
    // event ExtraFileEvent(uint256 n);
    event ExtraFileEvent();

    function compute(bool increment) external {
        // Should be treated as a branch
        require(increment);

        //emit ExtraFileEvent(2);
        emit ExtraFileEvent();
    }
}

In this case, we have 100% coverage.
If we rename the event as ExtraFileEvent(uint256) (or uncomment the lines) now we get 50% coverage.
What role are these events playing in code coverage?

confirmed fixed with https://github.com/foundry-rs/foundry/pull/8214


Solidity Support

Although I found several packages offering syntax support for the Solidity language (the language of Ethereum), I couldn't find any LS support. Below I describe my attempt to get the vscode-solidity language server up & running via Neovim. Hopefully this is a feature that we could add to this set of configs :)

nvim --version: v0.5.0
nvim-lspconfig version(commit hash): latest
What language server (If the problem is related to a specific language server): vscode-solidity's language server
Can you reproduce this behavior on other language server clients (vscode, languageclient-neovim, coc.nvim, etc.): no
Can you reproduce this behavior on other language servers offered in the nvim-lspconfig repo? (pyls -> pyright): no
Is the problem isolated to a particular language server: yes
Operating system/version: macOS Big Sur (v11.4)

How to reproduce the problem from neovim startup

Create a ~/.config/nvim/lua/vscsolls.lua file which adds to the lsconfig/configs

local configs = require "lspconfig/configs"
local util = require "lspconfig/util"

local server_name = "vscsolls"
local HOME = vim.fn.expand("$HOME")
-- we create this executable next
local bin_name = HOME .. "/.config/nvim/solidity_ls_exe.js"

configs[server_name] = {
    default_config = {
        cmd = {bin_name, "--stdio"},
        filetypes = {"solidity"},
        root_dir = util.root_pattern("package.json", ".git")
    },
    docs = {
        description = [[]],
        default_config = {
            root_dir = [[]]
        }
    }
}

Define the aforementioned executable ~/.config/nvim/solidity_ls_exe.js:

#!/usr/bin/env node

const path = require("path");
const os = require("os");
const fs = require("fs");
const cp = require("child_process");

const extensionsPath = path.resolve(os.homedir(), ".vscode", "extensions");
const extensionName = fs
  .readdirSync(path.resolve(os.homedir(), ".vscode", "extensions"))
  .find((name) => {
    return name.includes("solidity");
  });
const binPathAbsolute = path.join(
  extensionsPath,
  extensionName,
  "out",
  "src",
  "server.js"
);
const binPathRelative = path.relative(__dirname, binPathAbsolute);

require(binPathRelative);

... and make it executable
$ chmod u+x ~/.config/nvim/solidity_ls_exe.js

Require the file of step 1 and utilize it:

require "vscsolls"

lspconfig.vscsolls.setup {}

Actual behaviour
The LS is matched, but does not attach to the buffer :/

Any help getting this working would be greatly appreciated! Could even work on / PR the solution back to this repo on weekends.
LSP log

Log file
```
[ START ] 2021-07-25T15:23:22-0400 ] LSP logging initiated
[ INFO ] 2021-07-25T15:59:43-0400 ] ...l/Cellar/neovim/0.5.0/share/nvim/runtime/lua/vim/lsp.lua:1214 ]	"exit_handler"	{}
[ START ] 2021-07-25T15:59:44-0400 ] LSP logging initiated
[ INFO ] 2021-07-25T15:59:44-0400 ] ...llar/neovim/0.5.0/share/nvim/runtime/lua/vim/lsp/rpc.lua:316 ]	"Starting RPC client"	{  args = { "--stdio" },  cmd = "/Users/harrysolovay/.config/nvim/solidity_ls_exe.js",  extra = {}}
[ DEBUG ] 2021-07-25T15:59:44-0400 ] ...l/Cellar/neovim/0.5.0/share/nvim/runtime/lua/vim/lsp.lua:827 ]	"LSP[vscsolls]"	"initialize_params"	{  capabilities = {    callHierarchy = {      dynamicRegistration = false,       = <1>{        __tostring =       }    },    textDocument = {      codeAction = {        codeActionLiteralSupport = {          codeActionKind = {            valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" },             =           },           =         },        dynamicRegistration = false,         =       },      completion = {        completionItem = {          commitCharactersSupport = false,          deprecatedSupport = false,          documentationFormat = { "markdown", "plaintext" },          preselectSupport = false,          resolveSupport = {            properties = { "documentation", "detail", "additionalTextEdits" },             =           },          snippetSupport = true,           =         },        completionItemKind = {          valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },           =         },        contextSupport = false,        dynamicRegistration = false,         =       },      declaration = {        linkSupport = true,         =       },      definition = {        linkSupport = true,         =       },      documentHighlight = {        dynamicRegistration = false,         =       },      documentSymbol = {        dynamicRegistration = false,        hierarchicalDocumentSymbolSupport = true,        symbolKind = {          valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 },           =         },         =       },      hover = {        contentFormat = { "markdown", "plaintext" },        dynamicRegistration = false,         =       },      implementation = {        linkSupport = true,         =       },      publishDiagnostics = {        relatedInformation = true,        tagSupport = {          valueSet = { 1, 2 },           =         },         =       },      references = {        dynamicRegistration = false,         =       },      rename = {        dynamicRegistration = false,        prepareSupport = true,         =       },      signatureHelp = {        dynamicRegistration = false,        signatureInformation = {          documentationFormat = { "markdown", "plaintext" },           =         },         =       },      synchronization = {        didSave = true,        dynamicRegistration = false,        willSave = false,        willSaveWaitUntil = false,         =       },      typeDefinition = {        linkSupport = true,         =       },       =     },    window = {      showDocument = {        support = false,         =       },      showMessage = {        messageActionItem = {          additionalPropertiesSupport = false,           =         },         =       },      workDoneProgress = true,       =     },    workspace = {      applyEdit = true,      configuration = true,      symbol = {        dynamicRegistration = false,        hierarchicalWorkspaceSymbolSupport = true,        symbolKind = {          valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 },           =         },         =       },      workspaceEdit = {        resourceOperations = { "rename", "create", "delete" },         =       },      workspaceFolders = true,       =     },     =   },  clientInfo = {    name = "Neovim",    version = "0.5.0"  },  initializationOptions = vim.empty_dict(),  processId = 47557,  rootPath = "/Users/harrysolovay/Desktop/cryptocubes-core-v1",  rootUri = "file:///Users/harrysolovay/Desktop/cryptocubes-core-v1",  trace = "off",  workspaceFolders = { {      name = "/Users/harrysolovay/Desktop/cryptocubes-core-v1",      uri = "file:///Users/harrysolovay/Desktop/cryptocubes-core-v1"    } }}
[ DEBUG ] 2021-07-25T15:59:44-0400 ] ...llar/neovim/0.5.0/share/nvim/runtime/lua/vim/lsp/rpc.lua:395 ]	"rpc.send.payload"	{  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false,         = <1>{          __tostring =         }      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" },               =             },             =           },          dynamicRegistration = false,           =         },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },            preselectSupport = false,            resolveSupport = {              properties = { "documentation", "detail", "additionalTextEdits" },               =             },            snippetSupport = true,             =           },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },             =           },          contextSupport = false,          dynamicRegistration = false,           =         },        declaration = {          linkSupport = true,           =         },        definition = {          linkSupport = true,           =         },        documentHighlight = {          dynamicRegistration = false,           =         },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 },             =           },           =         },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false,           =         },        implementation = {          linkSupport = true,           =         },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 },             =           },           =         },        references = {          dynamicRegistration = false,           =         },        rename = {          dynamicRegistration = false,          prepareSupport = true,           =         },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            documentationFormat = { "markdown", "plaintext" },             =           },           =         },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false,           =         },        typeDefinition = {          linkSupport = true,           =         },         =       },      window = {        showDocument = {          support = false,           =         },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false,             =           },           =         },        workDoneProgress = true,         =       },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 },             =           },           =         },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" },           =         },        workspaceFolders = true,         =       },       =     },    clientInfo = {      name = "Neovim",      version = "0.5.0"    },    initializationOptions = vim.empty_dict(),    processId = 47557,    rootPath = "/Users/harrysolovay/Desktop/cryptocubes-core-v1",    rootUri = "file:///Users/harrysolovay/Desktop/cryptocubes-core-v1",    trace = "off",    workspaceFolders = { {        name = "/Users/harrysolovay/Desktop/cryptocubes-core-v1",        uri = "file:///Users/harrysolovay/Desktop/cryptocubes-core-v1"      } }  }}
[ WARN ] 2021-07-25T15:59:44-0400 ] ...l/Cellar/neovim/0.5.0/share/nvim/runtime/lua/vim/lsp.lua:87 ]	"method textDocument/codeAction is not supported by any of the servers registered for the current buffer"
```

This is all I could find that seemed somewhat official: https://github.com/ethereum/solidity/issues/7763

You should follow this PR https://github.com/ethereum/solidity/pull/11350
once it's merged, feel free to file a PR adding it to lspconfig.

Thought I'd share: solang (a Solidity toolchain from Hyperledger Labs) has a promising LS.
I managed to get the server attaching, although no diagnostics would show. Wondering if someone more familiar with the builtin LS internals would be willing to give it a try.

git clone https://github.com/hyperledger-labs/solang.git
cd solang/vscode && npm i && npm run compile
Relative to the vscode directory, open out/server/server.js and make it executable (insert #!/usr/bin/env node atop and chmod +x the file).
Add to the available lsp configs.

local configs = require 'lspconfig/configs'

local server_name = "solang"

configs[server_name] = {
    default_config = {
        init_options = {hostInfo = "neovim"},
        filetypes = {"solidity"},
        -- Replace with wherever your `server.js` is located.
        cmd = {"/Users/harrysolovay/solang/vscode/out/server/server.js", "--language-server", "--stdio"}
    },
}

Specify the file type:

vim.cmd("au BufRead,BufNewFile *.sol setfiletype solidity");

Call the LS setup:

lspConfig.solang.setup({
  root_dir: lspConfigUtil.root_pattern(".git"),
})

And surely enough, it now attaches to *.sol buffers:

I'm likely overlooking something. Any thoughts / advice would be greatly appreciated!

@harrysolovay did you check ~/.cache/nvim/lsp.log? There may be some info there as well, I will try setting this up later today.

Getting the following warning:
[ WARN ] 2021-09-05T14:40:06-0400 ] ...neovim/0.5.0/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ] "The language server solang triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
& thank you Christian!

It seems that––while Solang is being actively developed––the extension in which its LS lives is actually archived. Apologies for overlooking this initially. Didn't mean to get our hopes up.
Sadly I think we're back to waiting for the official LS from the Ethereum team :/

I mean, it's something:

I don't get any completion tho, I don't know yet if it supports goto definition or anything else.
For completion I've just been using tabnine. And for syntax highlighting I forked a fork of vim-solidity, which is just regex highlighting.

This is tremendous! Thank you for trying it out and confirming that it's possible to get it working. Did you do anything differently to get those diagnostics showing up?

@harrysolovay I have a PR here: https://github.com/neovim/nvim-lspconfig/pull/1225
that should explain everything you need to get it working.

I’m thrilled to see a PR! Will try it out ASAP.

Ok, so the PR is merged and we have solidity support, although, the server is extremely barebones and does not support completion. For future people reading this thread, there is nothing we can do about this, and if you are interested in completion/navigation support in solidity you will have to contribute to the upstream language server.

Just tried it out. While the Solang LS is certainly lacking, it's much better than nothing. A huge thank you to @mjlbach and @ChristianChiarulli for the speedy inclusion.

https://github.com/williamboman/nvim-lsp-installer/pull/296
Using @harrysolovay 's idea of porting the vscode-solidity language server to be used in nvim, I was able to publish the server as an npm package and successfully integrate the server into solidity_vscode. It supports completion, which imo is a step ahead the current solidity LS options.

This will in its initial release (this year hopefully!) only contain minimal features. We've disabled all experimental features that will however be added one-at-a-time after the initial merge of that PR. I'm saying that only so you don't expect all features to be present, but they'll come eventually. It's part of our 2022 planning. :)

Feel free (anyone) to file a PR adding to lspconfig when applicable :)

I followed the documentation  but I am not able to get solidity lsp working in nvim, nothing is being attached, although the solang cli i installed via cargo works fine


Inject user provided nft rules

This change ensures that user provided rules are injected into the edpm_nftables_src directory and loaded during rule generation.
The change adds a new variable to facilitate a user interface for rule injection edpm_nftables_user_rules.
Jira: https://issues.redhat.com/browse/OSPRH-11347

Looks good to me.

recheck


Update Gradle wrapper to 8.6

Motivation and Context
For details, see companion PR https://github.com/dita-ot/docs/pull/554.

❌ Superseded by #4447, closing…


Error when run locally

The comments below were machine-translated
@roanbaga commented on Thu May 07 2020
When I ran it manually, it always asked me to install the Azure Functions Core (even though I had done so several times), and when I arrived at the command "func: hosts start" it says that it doesn't recognize the command "func". After I went a thousand laps I found that it only worked (on my Windows 10) when the path of the system was included in the system path the path where the "func", in my case: "C:\Users<user>\AppData\Roaming\npm". There it all worked, it didn't ask to install the Azure Functions Core again and uploaded the server.
They should include that in the manual. On the other hand, when you copy the URL, it doesn't include the queryparam ?name-xxxxx, which makes it just fail. I don't know why he doesn't, in the example he says he should.

Detalles del documento
⚠ No edite esta sección. Se requiere para la vinculación de problemas de docs.microsoft.com ➟ GitHub.

ID: 04c9d43d-5bd2-87c6-2ccf-0c65ef193760
Version Independent ID: 6bf46ebc-481f-e4ef-b269-99bf99434601
Content: Creación de la primera función en Azure mediante Visual Studio Code
Content Source: articles/azure-functions/functions-create-first-function-vs-code.md
GitHub Login: @olprod

@srvbpigh commented on Thu May 07 2020
Hello, @roanbaga
Thank you for your feedback.
We are actively reviewing your comments and will get back to you soon.
Kind regards,
Microsoft DOCS International Team

duplicate of #54331


Add prototype sub-module to __init__

Makes prototype sub-module reachable from torchvision package API

Thanks for the PR @ioangatop
We won't be able to merge this: the intent is for the prototype area to not be part of our stable releases, and so not exposing it in torchvision.__init__.py is deliberate. You should still be able to access torchvision.prototype either through our nightly releases, or by building from source

Hi Nicolas,
I see, make sense. Thank you for your time!
I'll close the PR


Mypy import error

Running mypy src on qibolab, I get various errors. Among them, one is:
src/qibolab/instruments/rfsoc/driver.py:8: error:
Skipping analyzing "qibosoq": module is installed, but missing library stubs or py.typed marker  [import]

Clearly it's not a big problem, but why is it like this? Should we do something to fix it?
I think adding a py.typed file to src/qibosoq fixed the problem, but I don't have much experience and I don't know if this is something to do.
Do you, @AleCandido, know something more about this?

Yes, that's the proper way of doing it. I had not thought yet about seriously distributing types, it was more for internal use. But now that you took the burden of properly run Mypy and extensively introducing types in Qibosoq, it is fair to even properly distribute them.
https://peps.python.org/pep-0561/#packaging-type-information
(the PEP contemplates even the case of stubs, but we're only interested in inline types)


Unchecked math in number types

This reduces the gas used by from(int256, UFixed18) from 22440 to 22313 with viaIR, saving 127 gas.
One other optimization considered was wrapping division by BASE in unchecked. However, that did not save any gas.

good find 😎


Clean fields.py

Codecov Report

Merging #5 (4368656) into main (4b2a39a) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main        #5   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files           18        18
  Lines         1038       967   -71
=========================================
- Hits          1038       967   -71

Impacted Files
Coverage Δ

dantico/fields.py
100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


RequireHttpsMetadata set to false doesn't work

I tried to use http for development by setting RequireHttpsMetadata to false, but the app didn't work.
Below is the output from Visual Studio.
System.InvalidOperationException: The MetadataAddress or Authority must use HTTPS unless disabled for development by setting RequireHttpsMetadata=false.
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerPostConfigureOptions.PostConfigure(String name, JwtBearerOptions options)
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.OptionsMonitor`1.<>c__DisplayClass10_0.<Get>b__0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd(String name, Func`1 createOptions)
   at Microsoft.Extensions.Options.OptionsMonitor`1.Get(String name)
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.<InitializeAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationHandlerProvider.<GetHandlerAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.<AuthenticateAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler.<HandleAuthenticateAsync>d__2.MoveNext() in C:\local\identity\server4\AccessTokenValidation\src\IdentityServer4.AccessTokenValidation\IdentityServerAuthenticationHandler.cs:line 61
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.<AuthenticateAsync>d__47.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.<AuthenticateAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Exception","time":"2018-03-07T03:24:08.5955069Z","tags":{"ai.application.ver":"<IP_ADDRESS>","ai.cloud.roleInstance":"HUYTRAN-PC","ai.operation.id":"e7625c8e-4bc4b7d1982abc8e","ai.operation.parentId":"|e7625c8e-4bc4b7d1982abc8e.1.b4c5a2e7_","ai.operation.name":"GET /api/tickets","ai.location.ip":"::1","ai.internal.sdkVersion":"aspnet5c:2.2.1","ai.internal.nodeName":"HUYTRAN-PC"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"properties":{"AspNetCoreEnvironment":"Development","ConnectionId":"0HLC3RB787O4O","Exception":"System.InvalidOperationException: The MetadataAddress or Authority must use HTTPS unless disabled for development by setting RequireHttpsMetadata=false.\r\n   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerPostConfigureOptions.PostConfigure(String name, JwtBearerOptions options)\r\n   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)\r\n   at Microsoft.Extensions.Options.OptionsMonitor`1.<>c__DisplayClass10_0.<Get>b__0()\r\n   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)\r\n   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)\r\n   at System.Lazy`1.CreateValue()\r\n   at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd(String name, Func`1 createOptions)\r\n   at Microsoft.Extensions.Options.OptionsMonitor`1.Get(String name)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.<InitializeAsync>d__42.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationHandlerProvider.<GetHandlerAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationService.<AuthenticateAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler.<HandleAuthenticateAsync>d__2.MoveNext() in C:\\local\\identity\\server4\\AccessTokenValidation\\src\\IdentityServer4.AccessTokenValidation\\IdentityServerAuthenticationHandler.cs:line 61\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.<AuthenticateAsync>d__47.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationService.<AuthenticateAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.<Invoke>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.<Invoke>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.<Invoke>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.<Invoke>d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()","TraceIdentifier":"0HLC3RB787O4O:00000003","CategoryName":"Microsoft.AspNetCore.Server.Kestrel","DeveloperMode":"true","{OriginalFormat}":"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": An unhandled exception was thrown by the application."},"exceptions":[{"id":7425030,"typeName":"System.InvalidOperationException","message":"Connection id \"0HLC3RB787O4O\", Request id \"0HLC3RB787O4O:00000003\": An unhandled exception was thrown by the application.","hasFullStack":true,"parsedStack":[{"level":0,"method":"Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerPostConfigureOptions.PostConfigure","assembly":"Microsoft.AspNetCore.Authentication.JwtBearer, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":1,"method":"Microsoft.Extensions.Options.OptionsFactory`1.Create","assembly":"Microsoft.Extensions.Options, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":2,"method":"Microsoft.Extensions.Options.OptionsMonitor`1+<>c__DisplayClass10_0.<Get>b__0","assembly":"Microsoft.Extensions.Options, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":3,"method":"System.Lazy`1.ViaFactory","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":4,"method":"System.Lazy`1.ExecutionAndPublication","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":5,"method":"System.Lazy`1.CreateValue","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":6,"method":"Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd","assembly":"Microsoft.Extensions.Options, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":7,"method":"Microsoft.Extensions.Options.OptionsMonitor`1.Get","assembly":"Microsoft.Extensions.Options, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":8,"method":"Microsoft.AspNetCore.Authentication.AuthenticationHandler`1+<InitializeAsync>d__42.MoveNext","assembly":"Microsoft.AspNetCore.Authentication, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":9,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":10,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":11,"method":"Microsoft.AspNetCore.Authentication.AuthenticationHandlerProvider+<GetHandlerAsync>d__5.MoveNext","assembly":"Microsoft.AspNetCore.Authentication.Core, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":12,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":13,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":14,"method":"System.Runtime.CompilerServices.TaskAwaiter`1.GetResult","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":15,"method":"Microsoft.AspNetCore.Authentication.AuthenticationService+<AuthenticateAsync>d__10.MoveNext","assembly":"Microsoft.AspNetCore.Authentication.Core, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":16,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":17,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":18,"method":"IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler+<HandleAuthenticateAsync>d__2.MoveNext","assembly":"IdentityServer4.AccessTokenValidation, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null","fileName":"C:\\local\\identity\\server4\\AccessTokenValidation\\src\\IdentityServer4.AccessTokenValidation\\IdentityServerAuthenticationHandler.cs","line":61},{"level":19,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":20,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":21,"method":"System.Runtime.CompilerServices.TaskAwaiter`1.GetResult","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":22,"method":"Microsoft.AspNetCore.Authentication.AuthenticationHandler`1+<AuthenticateAsync>d__47.MoveNext","assembly":"Microsoft.AspNetCore.Authentication, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":23,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":24,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":25,"method":"System.Runtime.CompilerServices.TaskAwaiter`1.GetResult","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":26,"method":"Microsoft.AspNetCore.Authentication.AuthenticationService+<AuthenticateAsync>d__10.MoveNext","assembly":"Microsoft.AspNetCore.Authentication.Core, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":27,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":28,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":29,"method":"System.Runtime.CompilerServices.TaskAwaiter`1.GetResult","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":30,"method":"Microsoft.AspNetCore.Authentication.AuthenticationMiddleware+<Invoke>d__6.MoveNext","assembly":"Microsoft.AspNetCore.Authentication, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":31,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":32,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":33,"method":"Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware+<Invoke>d__3.MoveNext","assembly":"Swashbuckle.AspNetCore.SwaggerUI, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=4232c99127b3c254"},{"level":34,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":35,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":36,"method":"Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware+<Invoke>d__6.MoveNext","assembly":"Swashbuckle.AspNetCore.Swagger, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=62657d7474907593"},{"level":37,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":38,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":39,"method":"Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware+<Invoke>d__3.MoveNext","assembly":"Microsoft.AspNetCore.Diagnostics, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":40,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":41,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":42,"method":"Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware+<Invoke>d__11.MoveNext","assembly":"Microsoft.AspNetCore.Server.IISIntegration, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":43,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":44,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":45,"method":"Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware+<Invoke>d__3.MoveNext","assembly":"Microsoft.AspNetCore.Hosting, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":46,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":47,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":48,"method":"Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1+<ProcessRequestsAsync>d__2.MoveNext","assembly":"Microsoft.AspNetCore.Server.Kestrel.Core, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60"}]}],"severityLevel":"Error"}}}
Microsoft.AspNetCore.Server.Kestrel:Error: Connection id "0HLC3RB787O4O", Request id "0HLC3RB787O4O:00000003": An unhandled exception was thrown by the application.

Any suggestion for this situation? Thank you.

I only see Microsoft code on the call stack.
Either you ask them - or provide more details.


Missing Linting/Validation

First of all, absolutely love the work you've done. It's rare to see a good lean wrapper that just works. So thanks for your work.
I was wondering if it would be possible to add linting and validation to this? Similar to: https://codemirror.net/demo/lint.html
Thanks

Thank you, I'm glad that you find this wrapper useful!
This package uses codemirror 6, so we can use the @codemirror/lint to get linting. Here's a codesandbox example with javascript linting (using eslint). I'll be adding this as an example too.

Example added here!

Great, thanks for the example update I think that will help a lot of people since I eventually found an example by searching the forums for hours lol. See my journey here: https://discuss.codemirror.net/t/cm6-linting-and-error-notifications-highlighting/3425
One last thing that may actually be a bug:
I am trying to have the lintPanel open by default. I found a function (used in basicSetup to bind F8

^reopened with above comments

And if I'm doing something wrong please let me know, as I've been searching through documentation and forums to figure these out.

I can relate, there isn't much information on advanced use cases for codemirror 6. I had to search for about an hour to figure out how to set up linting.
I'm not sure if the TypeError there is a codemirror error or an error caused by this package. I checked both the onEditorViewChange and onEditorStateChange functions and they only seem to be getting called once (using the linting example) when the page is loaded. I'm getting the same error though.
I also was able to reproduce the openLintPanel behavior - nothing seems to be happening in the onEditorViewChange callback. Though I'm able to reproduce this error outside the library here. I think the intended (and working) use is this:
import { keymap } from '@codemirror/view'

const keyBinding: KeyBinding = {
    key: 'Ctrl-Shift-l',
    run: openLintPanel,
  }

const keyMapExtension = keymap.of([keyBinding])

I believe this is also an issue with codemirror. I recommend opening an issue over at codemirror/codemirror.next.

I've opened issues over at codemirror/codemirror.next#552 and codemirror/codemirror.next#553.

marijnh fixed both those issues, so this should be working now. You can check the linting example to see how to open the lint panel by default.


[Improvement][API] Change the way exceptions are handled in the API

Search before asking

[X] I had searched in the issues and found no similar feature requirement.

Description
Now we put the exception into the Result class and parse it.
This is not an elegant approach, so we would like to change the original
this.putMsg(result, Status.XXX, XXX);
return result;

to
throw new ServiceException(String.format("xxx %s doesn't valid", xxx));

Are you willing to submit a PR?

[ ] Yes I am willing to submit a PR!

Code of Conduct

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

I think putMsg and Exception are two different behaviors. We use putMsg to return valid error messages through API, while exceptions will not be returned through API.

I think putMsg and Exception are two different behaviors. We use putMsg to return valid error messages through API, while exceptions will not be returned through API.

@zhongjiajie Hi Jiajie, What's your opinion about this issue?

That make sense to me. And it's a big project to modify it. I suggest mark it as a DSIP and make a todo list just as we do in #10257. WDYT? @zhongjiajie

I think putMsg and Exception are two different behaviors. We use putMsg to return valid error messages through API, while exceptions will not be returned through API.

I have discuss with @caishunfeng , we think putMsg it is redundant and we should throw exception directly in serviceImpl, So we add a new ExceptionHandler in
https://github.com/apache/dolphinscheduler/blob/ae6aa53f963d2ea02ab435db1e5548da23e3f882/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/exceptions/ApiExceptionHandler.java#L39-L43
from api side, which will covert the ServiceException to Result object, and return in controller. And we already have some existing code in
https://github.com/apache/dolphinscheduler/blob/ae6aa53f963d2ea02ab435db1e5548da23e3f882/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java#L94-L105
And @SbloodyS do you think it is a good idea about this change? @SbloodyS

+1， make sense to me, Result is usually only used as a standard data format for external system interaction.