text:
Can't update to 1.16.2.1

zigbee2mqtt add-on version (if edge, please report commit hash):
1.16.1
Operating environment (HassOS, Virtual Machine, Device/platform running Home Assistant):

HassOS
Description of problem:
Can't update to 1.16.2 release - addon does not show available update, when I try to reload repository data, supervisor logs shows warning (see below)
Your entire configuration from the frontend (with sensitive fields redacted):
data_path: /share/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://core-mosquitto'
  user: *****
  password: *****
serial:
  port: /dev/ttyUSB0
advanced:
  log_level: warn
  report: true
  pan_id: 6755
  channel: 25
  network_key:
    - 1
    - 2
    - 5
    - 7
    - 9
    - 10
    - 13
    - 15
    - 0
    - 2
    - 4
    - 7
    - 8
    - 10
    - 11
    - 13
  availability_timeout: 300
  availability_blocklist:
    - '0x00158d00038e48fa'
  availability_passlist: []
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental:
  new_api: true
socat:
  enabled: false
  master: 'pty,raw,echo=0,link=/dev/ttyZ2M,mode=777'
  slave: 'tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5'
  restartdelay: 1
  initialdelay: 1
  options: '-d -d'
  log: false

Your logs from Home Assistant
20-12-03 11:31:25 WARNING (MainThread) [supervisor.store.data] Can't read /data/addons/git/7ad98f9c/zigbee2mqtt/config.json: does not match regular expression for dictionary value @ data['schema']['frontend']['host']. Got 'string?'
20-12-03 11:31:25 WARNING (MainThread) [supervisor.store.data] Can't read /data/addons/git/7ad98f9c/zigbee2mqtt-edge/config.json: does not match regular expression for dictionary value @ data['schema']['frontend']['host']. Got 'string?'

Same here 20-12-03 11:44:06 WARNING (MainThread) [supervisor.store.data] Can't read /data/addons/git/7ad98f9c/zigbee2mqtt/config.json: does not match regular expression for dictionary value @ data['schema']['frontend']['host']. Got 'string?' 20-12-03 11:44:06 WARNING (MainThread) [supervisor.store.data] Can't read /data/addons/git/7ad98f9c/zigbee2mqtt-edge/config.json: does not match regular expression for dictionary value @ data['schema']['frontend']['host']. Got 'string?'

I'll try to release a tested patch soon. Sorry for the inconvenience. You can try using https://github.com/zigbee2mqtt/hassio-zigbee2mqtt if you're in a rush. It works with the same config.

If I can help, the error I've got when I tried to update from 1.16.1 to  1.16.2.2 :
[supervisor.docker.interface] Can't install dwelch2101/zigbee2mqtt-amd64:1.16.2.2 -> 404 Client Error for http+docker://localhost/v1.40/images/create?tag=1.16.2.2&fromImage=dwelch2101%2Fzigbee2mqtt-amd64: Not Found ("manifest for dwelch2101/zigbee2mqtt-amd64:1.16.2.2 not found: manifest unknown: manifest unknown").

@Falconpage yes, that is a problem with the release process on this repo and how it handles tags and building of stable releases. That error will only go away on the new repo where a dev branch exists and where were can release new versions on the dev branch, build them and only when it works, publish in master.

Ok, if I understand well, we just have to  wait ?
You are working on a new repo ?

There are two repos:

https://github.com/danielwelch/hassio-zigbee2mqtt (this one)
https://github.com/zigbee2mqtt/hassio-zigbee2mqtt (a new fork that will become default in the future)

Currently the new one has no bugs as version 1.16.2 was not released there, so you can use https://github.com/zigbee2mqtt/hassio-zigbee2mqtt  safely.
I'm working on a fix that would fix problems on  https://github.com/danielwelch/hassio-zigbee2mqtt and release a patched version, and if that works I will release 1.16.2 also on https://github.com/zigbee2mqtt/hassio-zigbee2mqtt.
Basically we're trying at the moment to keep https://github.com/danielwelch/hassio-zigbee2mqtt  and https://github.com/zigbee2mqtt/hassio-zigbee2mqtt  in sync with version for a smooth transition soon (~1 month if all goes well).
Steps for the transition should be:

Keep both repos on at the same time until enough people test out zigbee2mqtt/hassio-zigbee2mqtt version to iron out potential problems
Merge back to danielwelch/hassio-zigbee2mqtt all changes: at this stage, docker images would get consumed from dockerhub zigbee2mqtt org
Reset zigbee2mqtt/hassio-zigbee2mqtt repo so it is no longer a fork of danielwelch/hassio-zigbee2mqtt
Update zigbee2mqtt documentation (not the add-on) to reflect zigbee2mqtt/hassio-zigbee2mqtt repo as main
Cleanup  danielwelch/hassio-zigbee2mqtt code to allow only configs pointing to dockerhub zigbee2mqtt org
Keep danielwelch/hassio-zigbee2mqtt as a lightweight config only version to store previous/older version in case there are severe bugs that are not solved in time (to avoid people getting problems with their significant other)

I am currently on the danielwelch branch and hassio detects that there is a new version (16.2.2) available, however, does not seem to do anything when I hit the update button. I have tried to restart the machine/addon with no effect still. Am I missing something?

@jamiekris you're not missing anything. The problem is with the release process. I'm working on testing 1.16.2.2 before i publish it to docker hub, but there is no easy way to do this without version upgrade in the config file, which resulted in 1.16.2.2 being made visible to home-assistant (as it uses master branch)
I'm trying to get this tested as soon as possible and released, but if it's an inconvenient you can use https://github.com/zigbee2mqtt/hassio-zigbee2mqtt.

I see both zigbee2mqtt and danielwelch have a release for 1.6.2 now but both give the same error on installing:
20-12-03 16:08:33 ERROR (SyncWorker_6) [supervisor.docker.interface] Can't install zigbee2mqtt/zigbee2mqtt-armv7:1.16.2 -> 404 Client Error for http+docker://localhost/v1.40/images/create?tag=1.16.2&fromImage=zigbee2mqtt%2Fzigbee2mqtt-armv7: Not Found ("manifest for zigbee2mqtt/zigbee2mqtt-armv7:1.16.2 not found: manifest unknown: manifest unknown").

@jamiekris you're not missing anything. The problem is with the release process. I'm working on testing 1.16.2.2 before i publish it to docker hub, but there is no easy way to do this without version upgrade in the config file, which resulted in 1.16.2.2 being made visible to home-assistant (as it uses master branch)
I'm trying to get this tested as soon as possible and released, but if it's an inconvenient you can use https://github.com/zigbee2mqtt/hassio-zigbee2mqtt.

https://github.com/zigbee2mqtt/hassio-zigbee2mqtt. url not working. Error when install. old url work.

@shirou93 https://github.com/zigbee2mqtt/hassio-zigbee2mqtt should work now. It seems Home Assistant for some reason broke the clean release process there by fetching the dev version of config.json (Even if stated differently in the docs). You were just unlucky to catch also the package in between builds. Try a new install and it should work.
Now both repos have 1.16.2 (org) & 1.16.2.2 (daniel) built and ready to be consumed, and hopefully work without problem.

I'm still investigating how ttps://github.com/zigbee2mqtt/hassio-zigbee2mqtt got version 1.16.2 announced as the master version (https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/master/zigbee2mqtt/config.json) still shows 1.16.1-1

Working now.

authors: Falconpage Mr-Groch ciotlosm jamiekris shirou93 wafprotocol xpavli44


text:
Last seen not saved

zigbee2mqtt add-on version (if edge, please report commit hash):
1.16.2.2
Operating environment (HassOS, Virtual Machine, Device/platform running Home Assistant):

Hassos 0.118.4
Description of problem:
If i change lastseen from none to another value in frontend, it work but if i restart zigbee2mqtt it return to "none"
Your entire configuration from the frontend (with sensitive fields redacted):
// replace this line with your pasted configuration

Your logs from Home Assistant

This is not a problem of the add-on. Try and post an issue on z2m issue tracker list for this. We won't be able to help you here.

source: gharchive/issue

authors: Maurotb ciotlosm

license_type: permissive

license_source: github-api


text:
[PRODUCTION] - Reverse Proxy

Description:
Create an Nginx reverse proxy server on the host machine, since we need to coordinate the containers and their connections we will need a way to centralize the requests and address them to the correct places
Acceptance:

Have Nginx configured to work as a reverse proxy
Allow access only to our React Server through ports 80 and 443

The reverse proxy was implemented and is working. closing issue

repo: danielyoshizawa/portifolio

license: MIT


text:
No debug tab window appears on Arduino IDE 2.1.1

No debug tab window appears on Arduino IDE 2.1.1
Using Linux Mint  21.2 o
exception decoder placed in here according to your directions while IDE was closed.
jponko@jponko-tc:~/.arduinoIDE/plugin$ ls
esp-exception-decoder-1.0.2.vsix
CTRL+SHIFT+p shows it in the list but no exception window appears when selected.
The IDE says this: Default VS Code API: 1.53.2
I don't use VS Code so I don't know if this is helpful.
System:
Kernel: 5.15.0-78-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Cinnamon 5.8.4
tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Machine:
Type: Desktop System: LENOVO product: 10FLS02D00 v: ThinkCentre M900
serial:  Chassis: type: 3 serial:
Mobo: LENOVO model: 30D0 v: SDK0J40697 WIN 3305025634376 serial:
UEFI: LENOVO v: FWKTB9A date: 08/17/2021
CPU:
Info: quad core model: Intel Core i5-6600T bits: 64 type: MCP arch: Skylake-S rev: 3 cache:
L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 800 min/max: 800/3500 cores: 1: 800 2: 800 3: 800 4: 800 bogomips: 21599

on Arduino IDE 2.1.1

Thank you for the bug report. Please try it with the nightly Arduino IDE 2.x build and let me know how it works: https://www.arduino.cc/en/software#nightly-builds.

Yes, the exception decoder window now works with the IDE current nightly
build but it is unable to decode the register dump. (see attached
screenshot)
On Sun, Jul 30, 2023 at 9:21 AM dankeboy36 @.***> wrote:

on Arduino IDE 2.1.1
Thank you for the bug report. Please try it with the nightly Arduino IDE
2.x build and let me know how it works:
https://www.arduino.cc/en/software#nightly-builds.
—
Reply to this email directly, view it on GitHub
https://github.com/dankeboy36/esp-exception-decoder/issues/8#issuecomment-1657186512,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFSPWDUPZDAMO7EMF3G2WE3XSZUU5ANCNFSM6AAAAAA24RW6HQ
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Jerry, AC9NM
手中的鳥在灌木叢中值兩個

Yes, the exception decoder window now works with the IDE current nightly

Great. The decoder does not work with 2.1.1, but the nightly Arduino IDE 2.x build.

build but it is unable to decode the register dump. (

What's the error? Can you share your environment details: the sketch, the selected board, and maybe the error message?

(see attached screenshot)

You did not attach anything. Please do not attach a screenshot, but copy the error message from the decoder console. Thanks!

Actually it does work, I made the mistake of not including the backtrace
line when I did the copy and paste. Here's the output:
ESP Exception Decoder
Sketch: NJAD_VFO_V1.1 FQBN: esp32:esp32:nodemcu-32s
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was
unhandled.
Core  1 register dump:
PC      : 0x400d1c15  PS      : 0x00060a30  A0      : 0x800da5dd  A1      :
0x3ffb27e0
A2      : 0x3ffc2750  A3      : 0x00000000  A4      : 0x00000080  A5      :
0x3ffc14a0
A6      : 0x3ffc14a4  A7      : 0x3ffc14a8  A8      : 0x00000000  A9      :
0x3ffb27c0
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x00000000  A13     :
0x00000003
A14     : 0x00000001  A15     : 0x00000000  SAR     : 0x00000014  EXCCAUSE:
0x0000001d
EXCVADDR: 0x00000000  LBEG    : 0x40086084  LEND    : 0x4008608f  LCOUNT  :
0xffffffff
Backtrace:0x400d1c12:0x3ffb27e00x400da5da:0x3ffb2820
PC: 0x400d1c15: setup() at
/media/jponko/odyssey/AC9NM/It-s-Not-Just-Another-Digital-VFO-by-WA2FZW-VK3PE-and-G3ZQC-Version-1.1/NJAD_VFO_V1.1/NJAD_VFO_V1.1.ino:359
EXCVADDR: 0x00000000
Decoding stack results
0x400d1c12: setup() at
/media/jponko/odyssey/AC9NM/It-s-Not-Just-Another-Digital-VFO-by-WA2FZW-VK3PE-and-G3ZQC-Version-1.1/NJAD_VFO_V1.1/NJAD_VFO_V1.1.ino:359
0x400da5da: loopTask(void*) at
/home/jponko/.arduino15/packages/esp32/hardware/esp32/2.0.5/cores/esp32/main.cpp:42
Paste exception to decode...

Thanks for fixing the exception decoder. I don't use it for my own code but
it helps with diagnosiing others code.
On Mon, Jul 31, 2023 at 6:40 AM dankeboy36 @.***> wrote:

Yes, the exception decoder window now works with the IDE current nightly
Great. The decoder does not work with 2.1.1, but the nightly Arduino IDE
2.x build.
build but it is unable to decode the register dump. (
What's the error? Can you share your environment details: the sketch, the
selected board, and maybe the error message?
(see attached screenshot)
You did not attach anything. Please do not attach a screenshot, but copy
the error message from the decoder console. Thanks!
—
Reply to this email directly, view it on GitHub
https://github.com/dankeboy36/esp-exception-decoder/issues/8#issuecomment-1658203256,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFSPWDSQZPXHE63JDJYVCZTXS6KURANCNFSM6AAAAAA24RW6HQ
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Jerry, AC9NM
手中的鳥在灌木叢中值兩個

Actually it does work,

I am glad it's working now. I am going to close this issue. If you do not agree, please let me know.

on Arduino IDE 2.1.1

Yes, the exception decoder window now works with the IDE current nightly

Great. The decoder does not work with 2.1.1, but the nightly Arduino IDE 2.x build.

See related: https://github.com/dankeboy36/esp-exception-decoder/issues/7#issuecomment-1636816401.


text:
[Internal] data type: constructor set

constructor set can have it's context extender when handling data type

stop tracking

repo: dannypsnl/violet


text:
Generate GDAX Deposit Address

Adding a method to generate and populate GDAX deposit addresses.  This is an undocumented feature but can be referenced from the Coinbase GitHub exchange found here: https://github.com/coinbase/gdax-node/issues/91

Unfortunately it doesn't seem to be working anymore, returns a 404 not found- are you experiencing the same thing?

This just worked for me to generate a BTC address:
from gdax.authenticated_client import AuthenticatedClient
if name == "main":
auth = AuthenticatedClient(api_key, api_b64secret, api_passphrase)
coinbase_accounts = auth.get_coinbase_accounts()
for coinbase_account in coinbase_accounts:
if coinbase_account['currency'] == 'BTC':
coinbase_account_id = coinbase_account['id']
 print(coinbase_account_id)
 address = auth.get_deposit_address(coinbase_account_id)
 print(address)

On Thu, Feb 22, 2018 at 11:14 PM, Dennis K notifications@github.com wrote:

Unfortunately it doesn't seem to be working anymore, returns a 404 not
found- are you experiencing the same thing?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/danpaquin/gdax-python/pull/216#issuecomment-367912134,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGxeVgm--8WEqzEA2_frA2hBP_ceyvD-ks5tXklEgaJpZM4RQLhS
.

source: gharchive/pull-request

authors: KeithSSmith flxfxp

repo: danpaquin/gdax-python


text:
Thanks so much

These templates are extremely helpful! Thanks so much for putting this together. This should really be integrated into the original project's demos or something. They're also well designed and nice to look at. Bravo!!

Yes @dariusgarza is very helpful! Thanks @dansup for the great work!

No problem! Bulma is an exciting new css framework and I look forward to releasing the new updated templates.

@dansup I was about to create another issue to give thanks!

authors: METACEO dansup dariusgarza fernandoguedes

repo: dansup/bulma-templates

license: mit

license_source: bigquery


text:
no proxy pls

can you made without promp for proxy,just direct

go buy proxy!


text:
Ability to stop Stylix from starting Hyprpaper service automatically

I feel like there should be a way of disabling the Hyprpaper part of the Hyprland module, as I want my Hyprland to be properly themed to my scheme but I have a script that sets wallpapers from a repository manually for me.
I want to be able to launch Hyprpaper and run the script as an exec-once call in Hyprland, but Stylix starts the SystemD Hyprpaper service so this becomes impossible, meaning that my wallpaper is set half of the time as I run into socket issues

I feel like there should be a way of disabling the Hyprpaper part of the Hyprland module

This was enabled by default according to:

This is wrong, hyprpaper works perfectly well as a standalone service for all wlroots-based compositors. It should be a separate target.

Depends whether we're only setting it up when it's already been enabled, or if we're also installing it by default. If we removed the services.hyprpaper.enable = true line then I would support it being separate.
On the other hand, enabling the service automatically is helpful for Hyprland users who expect the wallpaper to "just work".
-- https://github.com/danth/stylix/pull/377#issuecomment-2149968640

I want my Hyprland to be properly themed to my scheme but I have a script that sets wallpapers from a repository manually for me.
I want to be able to launch Hyprpaper and run the script as an exec-once call in Hyprland, but Stylix starts the SystemD Hyprpaper service so this becomes impossible, meaning that my wallpaper is set half of the time as I run into socket issues

Does https://github.com/danth/stylix/pull/501 resolve your issue?

Yup, just tested on your branch and everything hyprpaper was removed upon rebuilding once it was set to false. And once adding hyprpaper manually, my wallpaper script is working perfect so far. So seems working to me. Thank you!

One thing though is that when hyprpaper is enabled externally, it still attempts to apply the wallpaper as far as I can see. So it may still cause socket problems.

One thing though is that when hyprpaper is enabled externally, it still attempts to apply the wallpaper as far as I can see. So it may still cause socket problems.

The actual Hyprpaper service applies the following settings by default:
https://github.com/danth/stylix/blob/5853f1a8bd072f2ebabfc3de3973084353cf6f1e/modules/hyprpaper/hm.nix#L5-L13

Ahh, makes sense. Thank you.

I'm using stylix on NixOS (i.e. not home-manager) and I still get a build error saying I haven't defined a "hyprpaper service" (I don't use hyprland or hyprpaper). From what I understand, hyprland and hyprpaper are targets for home-manager and not NixOS. Will these targets be reflected on NixOS soon too?

@diego-est Please could you send the specific error message you're getting?

@diego-est Please could you send the specific error message you're getting?

Sorry, in between the time I uploaded this question and now I updated my flake inputs and now it works! (I think my nixpkgs input was just very out of date)

authors: AlxTray danth diego-est trueNAHO

repo: danth/stylix


text:
Exercise 19_02

It seems like this exercise doesn't have a solution just by adding parentheses, or I'm too stupid
/*
 * Fix the program
 *
 */

#include <assert.h>
#include <stdbool.h>
#include <stdio.h>

// ❌ I AM NOT DONE

int main() {
    int a = 1;
    int b = 2;
    int c = 3;
    int result;

    // Only add parentheses, so that result == 2
    result = b * c / a - b % c; // <-- Fix this line

    assert(result == 2);
    printf("The result is %d\n", result);

    return 0;
}

It has a solution. Perhaps I should mention that you need to add more than one pair of parentheses. @Heus-Sueh

@danwritecode this issue can be closed. I will later modify the hint.

authors: Heus-Sueh sleaper

repo: danwritecode/clings


text:
ModuleNotFoundError: No module named 'windows_auth'

Hi,
I followed the guide provided over here, but I am getting ModuleNotFoundError for "windows_auth" which I add in the INSTALLED_APPS list when I run the command python3 manage.py migrate windows_auth

You are correct, there was an incorrect configuration for the PyPI Packaging.
I've just released a new version 1.3.1 with a fix.

You are correct, there was an incorrect configuration for the PyPI Packaging.
I've just released a new version 1.3.1 with a fix.


text:
Disingenuous naming

I think it's a bit disingenuous to name your package ts-to-effect-schema, say you're targeting @effect/schema in your about header, then say you're targeting Zod in your README.md. Which is it? Did you do this just to snag a package name?
But it's your package, you name it what you want. I just think this puts a dark stain on your open source packages and your name.

The source was originally copied from a similar project which targeted zod. The author just didn’t bother to update the readme

The source was originally copied from a similar project which targeted zod. The author just didn’t bother to update the readme

OK. I guess. I still think though that a rename shouldn't have been that hard to do and it would help people find the package more easily as well by searching for what they want and getting what they expect as a result.
I certainly didn't expect to get a Zod library when I searched for Effect.

Yes looks like readme is similar to this repo - https://github.com/fabien0102/ts-to-zod

authors: adrian-gierakowski brokenthorn mz-makerstudio pmanole-volvocars

repo: daotl/ts-to-effect-schema


text:
Update

adjust Version Number to prevent confusion ...

Should have same Version Number as Main File - as it will bring confustion if they differ ... (Just "updated" all Files because I thought I had old Version ... until I realized that it's only an outdated Version Number in this File ...)

Fixed in latest version - thanks!

authors: dapphp futureweb

repo: dapphp/securimage


text:
[WIP]configuration api subscribe with azure service bus

Signed-off-by: Pravin Pushkar ppushkar@microsoft.com
Description
TODO: code cleanup, unsubscribe etc
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #2060
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:

[ ] Code compiles correctly
[ ] Created/updated tests
[ ] Extended the documentation / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]

Closing this POC PR as this will create hard dependency between azure app config and azure service.

repo: dapr/components-contrib


text:
Dapr runtime crash on grpc method invocation

In what area(s)?

/area runtime

/area operator
/area placement
/area docs
/area test-and-release

What version of Dapr?
grpc service method invocation call should work.

0.1.x
0.4
Output of git describe --dirty

Expected Behavior

Actual Behavior
== DAPR == time="2020-03-09T13:54:10-07:00" level=info msg="actors: placement order received: update"
== DAPR == time="2020-03-09T13:54:10-07:00" level=info msg="actors: placement tables updated"
== DAPR == time="2020-03-09T13:54:10-07:00" level=info msg="actors: placement order received: unlock"
== DAPR == panic: runtime error: invalid memory address or nil pointer dereference
== DAPR == [signal 0xc0000005 code=0x0 addr=0x18 pc=0x13bed46]
== DAPR ==
== DAPR == goroutine 122 [running]:
== DAPR == github.com/dapr/dapr/pkg/grpc.(*api).InvokeService(0xc0002f7420, 0x3530800, 0xc0006fc4e0, 0xc0001f2500, 0xc0002f7420, 0xc0006fc4e0, 0xc00068bb30)
== DAPR ==      D:/a/dapr/dapr/pkg/grpc/api.go:179 +0x76
== DAPR == github.com/dapr/dapr/pkg/proto/dapr._Dapr_InvokeService_Handler(0x2cf39a0, 0xc0002f7420, 0x3530800, 0xc0006fc4e0, 0xc0003ae900, 0x0, 0x3530800, 0xc0006fc4e0, 0xc000554110, 0x10)
== DAPR ==      D:/a/dapr/dapr/pkg/proto/dapr/dapr.pb.go:1038 +0x21e
== DAPR == google.golang.org/grpc.(*Server).processUnaryRPC(0xc000470480, 0x3569100, 0xc000314f00, 0xc000498000, 0xc000541770, 0x4cd5178, 0x0, 0x0, 0x0)
== DAPR ==      C:/Users/runneradmin/go/pkg/mod/google.golang.org/grpc@v1.26.0/server.go:1024 +0x4fb
== DAPR == google.golang.org/grpc.(*Server).handleStream(0xc000470480, 0x3569100, 0xc000314f00, 0xc000498000, 0x0)
== DAPR ==      C:/Users/runneradmin/go/pkg/mod/google.golang.org/grpc@v1.26.0/server.go:1313 +0xd9e
== DAPR == google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000446e80, 0xc000470480, 0x3569100, 0xc000314f00, 0xc000498000)
== DAPR ==      C:/Users/runneradmin/go/pkg/mod/google.golang.org/grpc@v1.26.0/server.go:722 +0xc2
Steps to Reproduce the Problem
Use service invocation to invoke method with no args.

@LMWF are you going to take that?

repo: dapr/dapr


text:
gRPC AppCallback OnInvoke is not invoked for HTTP->gRPC

In what area(s)?

/area runtime
What version of Dapr?

0.11.3
Expected Behavior

200 OK
{
  "id": "1234",
  "data": "data123"
}

Actual Behavior

500 Internal Sever Error
{
  "errorCode": "ERR_DIRECT_INVOKE",
  "message": "Message field is nil"
}

Steps to Reproduce the Problem

Run gRPC AppCallback service with debug log level
Example: https://github.com/RadoslavGatev/Dapr-gRPC-Invoke

dapr run --app-id testgrpc --dapr-http-port 3500 --app-protocol grpc --app-port 5001 --log-level debug -- dotnet run

Run a Dapr sidecar for the caller

dapr run --app-id caller --dapr-http-port 3600 --log-level debug

Invoke the gRPC service

POST http://localhost:3600/v1.0/invoke/testgrpc/method/GetData
{
  "id": "1234",
  "data": "data123"
}

Release Note

RELEASE NOTE: FIX gRPC AppCallback server OnInvoke callback failure
@youngbupark /cc: @yaron2 @ryanvolum @vinayada1

@RadoslavGatev - I downloaded your sample code to repro the issue and I do not see any error.
Dapr Runtime version = 1.0.0-rc.2
Dapr dotnet sdk version = 1.0.0-rc02
Logs:
== DAPR == time="2021-01-04T11:39:42.588359-08:00" level=warning msg="redis streams: BUSYGROUP Consumer Group name already exists" app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-04T11:39:42.588396-08:00" level=info msg="dapr initialized. Status: Running. Init Elapsed 4553.248ms" app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-04T11:40:06.87596-08:00" level=debug msg="error while reading spiffe id from client cert: unable to retrieve peer auth info. applying default global policy action" app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.runtime.grpc.api type=log ver=1.0.0-rc.2
== APP == info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
== APP ==       Request starting HTTP/2 POST http://127.0.0.1:5001/dapr.proto.runtime.v1.AppCallback/OnInvoke application/grpc -
== APP == info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
== APP ==       Executing endpoint 'gRPC - /dapr.proto.runtime.v1.AppCallback/OnInvoke'
== APP == info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
== APP ==       Executed endpoint 'gRPC - /dapr.proto.runtime.v1.AppCallback/OnInvoke'
== APP == info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
== APP ==       Request finished HTTP/2 POST http://127.0.0.1:5001/dapr.proto.runtime.v1.AppCallback/OnInvoke application/grpc - - 200 - application/grpc 115.5417ms
== DAPR == time="2021-01-04T11:40:08.036366-08:00" level=debug msg="Refreshing all mDNS addresses." app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.contrib type=log ver=1.0.0-rc.2

@RadoslavGatev - I downloaded your sample code to repro the issue and I do not see any error.
Dapr Runtime version = 1.0.0-rc.2
Dapr dotnet sdk version = 1.0.0-rc02
Logs:
== DAPR == time="2021-01-04T11:39:42.588359-08:00" level=warning msg="redis streams: BUSYGROUP Consumer Group name already exists" app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-04T11:39:42.588396-08:00" level=info msg="dapr initialized. Status: Running. Init Elapsed 4553.248ms" app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-04T11:40:06.87596-08:00" level=debug msg="error while reading spiffe id from client cert: unable to retrieve peer auth info. applying default global policy action" app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.runtime.grpc.api type=log ver=1.0.0-rc.2
== APP == info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
== APP ==       Request starting HTTP/2 POST http://127.0.0.1:5001/dapr.proto.runtime.v1.AppCallback/OnInvoke application/grpc -
== APP == info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
== APP ==       Executing endpoint 'gRPC - /dapr.proto.runtime.v1.AppCallback/OnInvoke'
== APP == info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
== APP ==       Executed endpoint 'gRPC - /dapr.proto.runtime.v1.AppCallback/OnInvoke'
== APP == info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
== APP ==       Request finished HTTP/2 POST http://127.0.0.1:5001/dapr.proto.runtime.v1.AppCallback/OnInvoke application/grpc - - 200 - application/grpc 115.5417ms
== DAPR == time="2021-01-04T11:40:08.036366-08:00" level=debug msg="Refreshing all mDNS addresses." app_id=testgrpc instance=vinayas-mbp.lan scope=dapr.contrib type=log ver=1.0.0-rc.2

Thank you for checking this! It's a shame I didn't know about the --runtime-version flag when initializing dapr.
It works with:
CLI version: 1.0.0-rc.3
Runtime version: 1.0.0-rc.2

Thank you for checking this! It's a shame I didn't know about the --runtime-version flag when initializing dapr.
It works with:
CLI version: 1.0.0-rc.3
Runtime version: 1.0.0-rc.2


text:
Error converting value "ERR_INVOKE_ACTOR" to type 'System.Nullable

Expected Behavior
i expected my program running correctly
Actual Behavior
whenever run，it's throw an error like this :
Error converting value "ERR_INVOKE_ACTOR" to type 'System.Nullable`1[Dapr.Actors.DaprErrorCodes]
Steps to Reproduce the Problem
i think the class "DaprErrorCodes" missing enumeration for "ERR_INVOKE_ACTOR"

@i542873057  Are you still seeing the issue with new dapr release and new nuget packages

repo: dapr/dotnet-sdk


text:
Enable vault name mapping and error suppression

Description
Enable vault name mapping and error suppression. This PR supersedes #1051 including the original changes from @yash-nisar
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #887
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:

[x] Code compiles correctly
[x] Created/updated tests
[ ] Extended the documentation

Thanks for the review @philliphoff. I will review your comments and make any amendments


text:
subscribe method updated

Description
The PR updates the subscribe method so that it takes a handler as an argument which will be executed whenever there is an update notification. Also the subscribe call returns ID in it's response as specified in sdk-spec(https://github.com/dapr/sig-sdk-spec/blob/main/spec/alpha/configuration.md). It updates the unsubscribe method to unsubscribe using ID, instead of a key.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #488
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:

[ ] Code compiles correctly
[ ] Created/updated tests
[ ] Extended the documentation

There are remaining linter issues, and the example E2E test hasn't been updated for the changed output. The Readme.md in the example folder acts as integration test - you can see the expected output lines there which must be modified.
Please make sure to run tox -e type tox -e flake8 tox -e py311 (or 39 or whatever - depends on the the Python version you are using) to help you catch type, linter and unit test problems.
You can run the examples integration test via tox -e examples , to just run the configuration API example, navigate to the examples folder and then run ./validate.sh configuration (this assumes you have mechanical-markdown installed - via pip3 install mechanical-markdown)

Resolved

repo: dapr/python-sdk


text:
DAPR_HTTP_PORT: undefined for hello-kubernetes sample

I'v followed the steps in quickstarts/hello-kubernetes README.md to run the node application. In Step 4 -Verify Service, the command curl http://localhost:8080/ports results in:{}
However, it should be(expected output):{"DAPR_HTTP_PORT":"3500","DAPR_GRPC_PORT":"50001"}
It seemed that the dapr injector failed to set environment variables in app.js:
const daprPort = process.env.DAPR_HTTP_PORT;
const daprGRPCPort = process.env.DAPR_GRPC_PORT;

Here are some output for my k8s deployments:
k8s components(2 ubuntu 20.04 boxes in VirtualBox)
kubectl get pod -n kube-system -o wide
NAME                                 READY   STATUS    RESTARTS   AGE    IP               NODE         NOMINATED NODE   READINESS GATES
coredns-66bff467f8-jwtzv             1/1     Running   18         6d5h   10.244.0.168     k8s-master   <none>           <none>
coredns-66bff467f8-p85r5             1/1     Running   18         6d5h   10.244.0.169     k8s-master   <none>           <none>
etcd-k8s-master                      1/1     Running   19         6d5h   192.168.56.100   k8s-master   <none>           <none>
kube-apiserver-k8s-master            1/1     Running   19         6d5h   192.168.56.100   k8s-master   <none>           <none>
kube-controller-manager-k8s-master   1/1     Running   21         6d5h   192.168.56.100   k8s-master   <none>           <none>
kube-flannel-ds-m7ndq                1/1     Running   2          23h    192.168.56.101   k8s-node-1   <none>           <none>
kube-flannel-ds-tz8wc                1/1     Running   2          23h    192.168.56.100   k8s-master   <none>           <none>
kube-proxy-dhljf                     1/1     Running   13         6d5h   192.168.56.101   k8s-node-1   <none>           <none>
kube-proxy-s8cxx                     1/1     Running   18         6d5h   192.168.56.100   k8s-master   <none>           <none>
kube-scheduler-k8s-master            1/1     Running   19         6d5h   192.168.56.100   k8s-master   <none>           <none>

dapr components
get pod -n dapr-system -o wide
NAME                                     READY   STATUS    RESTARTS   AGE   IP            NODE         NOMINATED NODE   READINESS GATES
dapr-dashboard-87fcd7c55-h8q7r           1/1     Running   1          23h   10.244.1.17   k8s-node-1   <none>           <none>
dapr-operator-6c994c69b7-82npf           1/1     Running   1          23h   10.244.1.18   k8s-node-1   <none>           <none>
dapr-placement-server-0                  1/1     Running   1          23h   10.244.1.13   k8s-node-1   <none>           <none>
dapr-sentry-64789d9cb5-4j946             1/1     Running   1          23h   10.244.1.15   k8s-node-1   <none>           <none>
dapr-sidecar-injector-7698bcc85f-m2ztl   1/1     Running   1          23h   10.244.1.16   k8s-node-1   <none>           <none>

dapr-sidecar-injector logs
kubectl logs pod/dapr-sidecar-injector-7698bcc85f-m2ztl -n dapr-system
time="2022-01-10T13:20:02.279087247Z" level=info msg="log level set to: info" instance=dapr-sidecar-injector-7698bcc85f-m2ztl scope=dapr.injector type=log ver=unknown
time="2022-01-10T13:20:02.294752014Z" level=info msg="metrics server started on :9090/" instance=dapr-sidecar-injector-7698bcc85f-m2ztl scope=dapr.metrics type=log ver=unknown
time="2022-01-10T13:20:02.307335861Z" level=info msg="starting Dapr Sidecar Injector -- version 1.5.1 -- commit c6daae8e9b11b3e241a9cb84c33e5aa740d74368" instance=dapr-sidecar-injector-7698bcc85f-m2ztl scope=dapr.injector type=log ver=unknown
time="2022-01-10T13:20:02.340628173Z" level=info msg="Healthz server is listening on :8080" instance=dapr-sidecar-injector-7698bcc85f-m2ztl scope=dapr.injector type=log ver=unknown
time="2022-01-10T13:20:02.450448008Z" level=info msg="Sidecar injector is listening on :4000, patching Dapr-enabled pods" instance=dapr-sidecar-injector-7698bcc85f-m2ztl scope=dapr.injector type=log ver=unknown

dapr-sidecar-injector describe
kubectl describe pod/dapr-sidecar-injector-7698bcc85f-m2ztl -n dapr-system
...
Events:
  Type     Reason                  Age                From                 Message
  ----     ------                  ----               ----                 -------
  Normal   Scheduled               23h                default-scheduler    Successfully assigned dapr-system/dapr-sidecar-injector-7698bcc85f-m2ztl to k8s-node-1
  Normal   Pulled                  23h                kubelet, k8s-node-1  Container image "docker.io/daprio/dapr:1.5.1" already present on machine
  Normal   Created                 23h                kubelet, k8s-node-1  Created container dapr-sidecar-injector
  Normal   Started                 23h                kubelet, k8s-node-1  Started container dapr-sidecar-injector

nodeapp
kubectl describe pod/nodeapp-66dcfff64d-wlnv9
Events:
  Type    Reason     Age   From                 Message
  ----    ------     ----  ----                 -------
  Normal  Scheduled  23m   default-scheduler    Successfully assigned default/nodeapp-66dcfff64d-wlnv9 to k8s-node-1
  Normal  Pulled     22m   kubelet, k8s-node-1  Container image "dapriosamples/hello-k8s-node:latest" already present on machine
  Normal  Created    22m   kubelet, k8s-node-1  Created container node
  Normal  Started    22m   kubelet, k8s-node-1  Started container node

and
kubectl logs pod/nodeapp-66dcfff64d-wlnv9
Node App listening on port 3000!
DAPR_HTTP_PORT: undefined
DAPR_GRPC_PORT: undefined

Would anybody give any advice?

What k8s distribution are you using?

I just installed kubelet、kubeadm、and kubectl. The master node was initialized by kubeadm init, and the slave node joined in by kubeadm join.
Should I distribute k8s by using minikube?

I just installed kubelet、kubeadm、and kubectl. The master node was initialized by kubeadm init, and the slave node joined in by kubeadm join. Should I distribute k8s by using minikube?

Can you try? This is pretty much covered in our e2e tests so I suspect it might be cluster related.

It worked in minikube!
And I noticed the comments in quickstarts README.md:
This quickstart requires you to have the following installed on your machine:
kubectl
A Kubernetes cluster, such as Minikube, AKS or GKE

A k8s cluster is a must.
Thanks for your advice!

repo: dapr/quickstarts


text:
beam sample

作者您好！我复现了您的代码，发现在您的代码中并没有使用beam search 策略，当我使用beam search策略进行测试时，发现指标并没有明显的提升，您可以帮我解答疑惑吗？

This is normal. As far as I know, the improvement from beam search is limited for many sophisticated models.

authors: JankinTian daqingliu

repo: daqingliu/CAVP


text:
Improve start.py for windows host machine

On a Windows host machine the following things appear (to me)

if i mount my .ssh folder the permissions of the files are not correct. They are 755 (due to usage of them in windows?) We could check the permissions and correct them
in the .ssh/config the paths can be defined as absolute paths. this absolute paths will not work in the container. We should investigate if we could just use relative paths and if this works in the container and the windows host machine
even if i mount the .gitconfig file, i still have to run the "git config ..." commands. Did not investigate why.

was my own fault 🤣
not due the container..

repo: dariusgm/lunarvim


text:
Image Elements as Attachments?

Thanks for your work. But is it possible to send all images as attachments in a toot?
And I find that this tool will convert all mp3 to links, is it possible to convert all other elements that mastodon not support to links (e.g. <video>, <audio>, <img>, <iframe>, <embed>)?
By the way, I hope this site can search by username or rss links, since all posts will not be showed in public timeline and if someone reboost a message, only those follow him at the same instance can see the message ...

Thanks, it seems all right to me now...

Yeah, I haven't figured out how to do galleries yet.

Well, maybe just a list of attachment?
Here is an example from Pawoo:
>>> requests.get("https://pawoo.net/users/ysd/statuses/101718360273748843", headers={"Accept": 'application/activity+json'}).text

And the response:
{
    "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", {
        "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
        "sensitive": "as:sensitive",
        "movedTo": "as:movedTo",
        "Hashtag": "as:Hashtag",
        "ostatus": "http://ostatus.org#",
        "atomUri": "ostatus:atomUri",
        "inReplyToAtomUri": "ostatus:inReplyToAtomUri",
        "conversation": "ostatus:conversation",
        "toot": "http://joinmastodon.org/ns#",
        "Emoji": "toot:Emoji",
        "focalPoint": {
            "@container": "@list",
            "@id": "toot:focalPoint"
        },
        "featured": "toot:featured",
        "schema": "http://schema.org#",
        "PropertyValue": "schema:PropertyValue",
        "value": "schema:value"
    }],
    "id": "https://pawoo.net/users/ysd/statuses/101718360273748843",
    "type": "Note",
    "summary": null,
    "content": "\\u003cp\\u003e馬鹿と煙は高いところへ上る\\u003c/p\\u003e",
    "inReplyTo": null,
    "published": "2019-03-09T02:36:43Z",
    "url": "https://pawoo.net/@ysd/101718360273748843",
    "attributedTo": "https://pawoo.net/users/ysd",
    "to": ["https://www.w3.org/ns/activitystreams#Public"],
    "cc": ["https://pawoo.net/users/ysd/followers"],
    "sensitive": false,
    "atomUri": "https://pawoo.net/users/ysd/statuses/101718360273748843",
    "inReplyToAtomUri": null,
    "conversation": "tag:pawoo.net,2019-03-09:objectId=120586859:objectType=Conversation",
    "attachment": [{
        "type": "Document",
        "mediaType": "image/jpeg",
        "url": "https://img.pawoo.net/media_attachments/files/013/041/272/original/99ce3e980221e458.jpeg",
        "name": null,
        "focalPoint": [0.01, 0.6]
    }, {
        "type": "Document",
        "mediaType": "image/jpeg",
        "url": "https://img.pawoo.net/media_attachments/files/013/041/278/original/4414e4ed4aec76bf.jpeg",
        "name": null,
        "focalPoint": [0.01, 0.6]
    }, {
        "type": "Document",
        "mediaType": "image/jpeg",
        "url": "https://img.pawoo.net/media_attachments/files/013/041/291/original/ebe6cc96aa645ef7.jpeg",
        "name": null,
        "focalPoint": [0.01, 0.6]
    }, {
        "type": "Document",
        "mediaType": "image/jpeg",
        "url": "https://img.pawoo.net/media_attachments/files/013/041/307/original/9f935876e45f7b63.jpeg",
        "name": null,
        "focalPoint": [0.01, 0.6]
    }],
    "tag": []
}

All media files (mp3, mp4, gif, jpg, ... ) can be placed on here, too. The only problem is that I don't know how Mastodon handles a toot with more than 4 attachments ...

Hi! I've added support for galleries for up to the first 4 items. It should work for new things posted with 2 or more images. Can you tell me if it works for you?

For more than 4 attachments I remember reading that mastodon just ignore them.

Closing this as I added support a few months back.

authors: Dostoi aka-rin dariusk

repo: dariusk/rss-to-activitypub


text:
Feat/core/default cache control behaviour

Thanks to @Menci

@Menci IMHO we're good and we can merge it.

Thank you @Menci for your awesome work! 👏

repo: darkweak/souin


text:
Update index.html

Added supported architectures, expanded the iOS roadmap, and removed the UIKit implementation (WinObjC and touchHLE already have done most work)

There should be some sort of note to prevent non-technical users coming from Wine from installing this app and only being disappointed for now.


text:
Add callbacks and improve WAMP error handling

This pull request improves wampcc and makes its error handling WAMP-specification compliant.
Improvements:

Add option for listening on IPv6 only
Pass  the session ID to authorization provider when authorizing an action
Pass WAMP Options dict when handling an RPC REGISTER event
Add callback for when an RPC is unregistered
Pass the realm name when calling the RPC registration callback
Add realm name  to rpc_details struct
Move definition of rpc_details to wamp_router.h, as it its needed using by RPC registration callbacks

Presently, when an exception is raised with a message, for example:
https://github.com/darrenjs/wampcc/blob/066439f17c4e8977c348d74867b9a3492ce08572/libs/wampcc/wamp_router.cc#L138
then, depending on how the exception is caught, the second part of the exception message (e.g. "call is not authorized" above) is used as the error URI when the error is transmitted. This is in violation of the WAMP specification.
This pull request ensures that the error URI is always used. If there is an exception message then it is placed inside a "_reason" field in the WAMP error Details dict.

Hi ,
Thanks for all the changes.  I have been going through them.  Here are my current thoughts:

member realm added to rpc_details; wondering if that is necessary, because the realm can always be obtained from the session handle.  Although, can see the point that session handle can have expired.

why move rpc_details to different file?

like the overall refactoring of error, and sending error_uri back to wamp peer; however, the wamp_error constructor is now doing string construction (i.e. .append()).  I think its best to defer that to the catch site, for perf reasons.  I.e. prefer wamp_error just stores primitive fields, and catch locations do whatever embellishments are required.

am still following through the new logic of the is_welcome() attribute;  isn't this similar to is_open() ?

My plan for these changes is to go ahead with merge, but then refine some of the changes to the wamp error class; e.g. avoid the string concatenation in the constructor.

Thanks for merging this @darrenjs . Apologies for may late response as I didn't get a chance to reply last week.
With regards to the points that you mentioned:

I had to add the realm because now the on_rpc_registered is also called when an internal RPC is registered. In this case the session handle would be null.

rpc_details was in a private header, but will now be needed by the on_rpc_registered and on_rpc_unregistered callbacks. I didn't want to make the whole of that header public, hence why it has been moved to another header that is already public.

I see you point about not doing string operations in the router, feel free to  take that out.

is_welcome() has a slightly different function to is_open(), mainly become is_welcome() is set after the WAMP WELCOME message has been sent to a client.
When a client connects, the handle_session_state_change callback gets called only after WELCOME (i.e after the connection is successfully setup). However, the handle_session_state_change can be called at any time during disconnection, even if the client has not authenticated yet.
This results in a situation when the handler will be called on disconnection but not on connection (for example if the client could not authenticate and so the session was closed before the WELCOME message was sent).  Having is_welcome() allows the callback code inside handle_session_state_change to know if the if the session has been fully setup.

authors: darrenjs samangh

repo: darrenjs/wampcc


text:
Would be nice to be able to not show warnings from packages/

Maybe this is already possible?  Normally I want to see warnings in packages/ but right now I'm working around INFO warnings in intl.dart: https://github.com/dart-lang/intl/pull/76

This is a pretty low priority issue for me.  Just figured I should file.

Cool. We had one other report of this. We shouldn't be showing warnings from the packages/ dir. What repo is this happening in for you?

a local project which Atom created for me. I can push it to github, but right now it's not even a git repo.

I'm guessing these warnings don't show up until after you've navigated to the file once?

http://filebin.ca/2DVK5lM6wSvT/grid.tgz

Not sure.  I had more than one project open in the same atom workspace.  The other project I had open used this library, this one didn't.  However, Sky now depends on intl as of yesterday.

@brianwilkerson @stereotype441
It looks like pub is creating dart files in .pub/deps/debug/intl/.

Closing in favor of https://github.com/dart-lang/sdk/issues/24212; thanks for the report.

authors: devoncarew eseidelGoogle

repo: dart-atom/dartlang


text:
Refactor driver to be more testable.

TL;DR our test coverage is lacking; let's get to fixing that by making the Driver more test-friendly.

This issue was moved to dart-lang/sdk#25149


text:
Enable more experiments in the dart-pad master channel

Cf. https://github.com/dart-lang/dart-pad/issues/2479, where @modulovalue expressed similar ideas.
In order to offer convenient access to upcoming Dart features in dart-pad, we could consider enabling a larger set of experiments in the master channel, or we might add a new channel (perhaps "bleeding_edge") where every experiment that has an experiment flag is enabled (or at least every experiment which isn't considered too incomplete or too unstable to be a useful foundation for exploration).
The point is that this allows developers who are interested in the evolution of Dart to try out various small experiments in Dart-with-X for any experiment X which is included. The same thing could be done using command line tools in a suitable version with --enable-experiment=X, but dart-pad is a very convenient place for trying out small exploratory programs.
Another benefit could be that upcoming experiments are thus being tested more intensively, all enabled at the same time, and this could help detecting bugs that arise because of conflicts between the code enabled for one experiment and that for a different experiment.
Here are some example experiments that may fit the bill: records, patterns, sealed-class, class-modifiers, inline-class, variance, unnamed-libraries.
(macros would certainly be interesting to have, too, but I don't know if that feature would satisfy the constraints imposed by running a program in dart-pad.)

We need a bit more time to finalize this (i.e. get past the branching point), but from what I currently know, I think the only flag we want for I/O is inline-class

We need a bit more time to finalize this (i.e. get past the branching point), but from what I currently know, I think the only flag we want for I/O is inline-class

Ping me when you are ready to modify the experiment flags in master. Thanks!

Now that master has branched to 3.1, should we enable inline-class?

Yes, that would be fine

Now that master has branched to 3.1, should DartPad enable inline-class?

Put this into a PR after landing https://github.com/dart-lang/dart-services/pull/1058 as the dart versions on each channel are now explicit

inline-class is now enabled on the master channel: https://dartpad.dev/?channel=master&id=2b6e078305c37f0cf0599a116501a655

Proof of life:

authors: domesticmouse eernstg mit-mit parlough

repo: dart-lang/dart-pad


text:
_deepEquals() doesn't work when a mixin implements Map

It looks like this could be triggered by a repeated field that contains protobufs that have a mixin that implements Map. It should check for GeneratedMessage first, then Map.
https://github.com/dart-lang/dart-protobuf/blob/master/lib/src/protobuf/utils.dart#L8

Should be fixed in 0.5.1

repo: dart-lang/dart-protobuf


text:
[macOS] framework gets added twice

Reproducible with package ffi.
flutter create --template=package_ffi test_assets
cd test_assets/example
flutter build macos
ls build/macos/Build/Products/Release/test_assets_example.app/Contents/Frameworks

This will contain
test_assets.framework
test_assets1.framework

cc @dcharkes

My guess would be that on macos Uri frameworkUri(String fileName, Set<String> alreadyTakenNames) is called twice for same framework, probably during lipo?
test_assets.framework is arm64
test_assets1.framework is x86_64
Since these are different architectures, that would mean that they are not linked with the executable either. And otool -L seems to confirm that.

Thanks for the report @knopp!

My guess would be that on macos Uri frameworkUri(String fileName, Set<String> alreadyTakenNames) is called twice for same framework, probably during lipo?
test_assets.framework is arm64 test_assets1.framework is x86_64
Since these are different architectures, that would mean that they are not linked with the executable either. And otool -L seems to confirm that. EDIT: Maybe linking is not necessary? I'm not entirely sure how @Native resolves functions on macOS. I assumed it was DynamicLibrary.process but maybe I have that wrong.

Indeed, we do dynamic loading, not dynamic linking. The mapping from arch+assetId -> framework-name is embedded in the Dart compilation and used at runtime to dlopen the dylib in the framework.
I'm a bit surprised we end up with two frameworks for different archs. We should have all archs in a single framework:
https://github.com/flutter/flutter/blob/e73e7e2e56638b3e2d2f50aadd964fa312205b60/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart#L264-L271
(P.S. this is an issue with the implementation in flutter_tools, transferring to flutter repo.)

Thanks for looking into this @knopp!

KernelAssetAbsolutePath not having operator== and hashCode implementation. The path is used to group artifacts for lipo, and with default instance equality that fails.

Seems like I broke this recently: https://github.com/dart-lang/native/pull/964 Apparently no tests failed in either there, nor in flutter_tools. 🙈

_fatAssetTargetLocations will increment the asset name if present in alreadyTakenNames even if the asset has same Id and is just different target.

Hm, we'd need to do the group before the renaming. Should be a relatively easy refactor for the iOS/MacOS code.
(I think that currently nothing is broken, we should dlopen at runtime with the different framework paths on the different architectures. But it would still be cleaner to ship the them in the same framework, so we should clean this up.)
Feel free to submit a PR to fix it.

@dcharkes, I have possible solution here: https://github.com/flutter/flutter/pull/144688/files. It doesn't require KernelAssetAbsolutePath operator== override because it reuses instance, but that might be something to consider doing anyway.

Yeah, feel free to submit a PR on both repos.
I think grouping on assetId is fine.

I think this has been fixed by https://github.com/flutter/flutter/pull/144688.

authors: dcharkes knopp

repo: dart-lang/native


text:
Use FieldDescriptorProto.json_name for representing field names.

This seems to be the right thing to do if we want to emit
proto3 JSON.
Currently we were using the dart mangled name, that is also camel-case
but has a number of dart-specific disambiguations applied making it unsuitable for
interop.
If we want to parse JSON we need also know the field_name (with
underscores). That is for a later PR...

https://github.com/dart-lang/protobuf/issues/153

CC @nichite

repo: dart-lang/protobuf


text:
Authorize account before added as uploader

The current single-page will be split into two:

First an "uploader approval" view is presented, with a link to Google OAuth and a disclaimer about being added will also display the e-mail address.
After approval the same page will check the auth credentials and if authorized, the new uploader will be added to the package.

URLs:

The uploader confirmation URL is in the structure of: /admin/confirm/new-uploader/<package>/<uploader-email>/<nonce>.
The OAuth redirect/callback URL will be /oauth/callback
The OAuth state parameter will be the URL of the original confirmation page.
The OAuth callback handler uses the state parameter and redirects the request to the original uploader confirmation page.

The uploader confirmation handler updates/confirms the request only if a valid auth code is present AND the verified user e-mail is the same as was on the invite.

PTAL.

PTAL

I did quick edit through the github UI, it probably associated the wrong email with the commit, cla/yes.

Merged through #2134

authors: isoos jonasfj

repo: dart-lang/pub-dartlang-dart


text:
Formatter gets confused line-wrapping nested lambdas

Source:
main() {
  barback.getAssetById(transformerAsset)
    .then((_) => transformerAsset)
    .catchError((e) => new AssetId(package, 'lib/$package.dart'),
          test: (e) => e is AssetNotFoundException);
}
Output:
main() {
  barback.getAssetById(transformerAsset).then((_) =>
      transformerAsset).catchError((e) => new AssetId(package, 'lib/$package.dart'),
      test: (e) => e is AssetNotFoundException);
}
I don't expect it to do as good a job line wrapping as I do, but at the very least it should stay within 80 columns.

This issue has been moved to dart-lang/dart_style#304.

authors: DartBot munificent

repo: dart-lang/sdk


text:
Sanitization throws on embed elements in Firefox

An embed element in Firefox is not an object, the typeof says Function. As a result we don't get an interceptor for it and it doesn't have methods. We probably need to drop down into JS to see if it's a reasonable element or not. We may be able to just outright reject <embed>.  See, e.g. co19/LayoutTests/fast/loader/loadInProgress_t01

Closing as obsolete as I don't think anyone's hit this in years.

authors: alan-knight vsmenon


text:
if/else promotion with FutureOr could be improved

Currently if I write:
import 'dart:async';

Future<int> plus1(FutureOr<int> value) {
  if (value is Future<int>) {
    return value.then((n) => n + 1);
  } else {
    return new Future.value(value + 1);
  }
}

I get [error] The operator '+' isn't defined for the class 'FutureOr<int>'. In principle, the analyzer has enough information to figure out that value is of type int in the else block, since it's either that or Future<int> and the former option has already been eliminated.
I expect that it isn't realistic to solve this until we start working on union types (#4938) more seriously, but I wanted to get it documented.

+1
We discussed adding this, but held off for the initial feature.  @bwilkerson this would be a good thing to consider when you get cycles to follow up on the proposal for improved type promotion that you wrote up in the fall.

Agreed. I'm basically waiting until the language team has time to consider it again.

See also #28768.

moving to area-language for triage

This is planned for the nnbd release, and is tracked here.

authors: bwilkerson jmesserly leafpetersen nex3


text:
Should List foos = [] infer as List?

An internal customer ran into this pattern today:
class X {
  List foos = <Foo>[];
}

... where it is (properly, at least according to the new spec) inferring as List<dynamic>, which in turn causes runtime errors when trying to assign foos to a true List<Foo>. I understand the intention behind this:
class X {
  // Don't infer me as List<int>
  List<dynamic> anything = [1, 2, 3];
}

Though the following is less clear than me.
In my head anything should just care about being a List, but its assigned value should be of List<int>, not List<dynamic>:
class X {
  // Don't infer me as List<int>... for some reason.
  List<dynamic> anything = <int>[1, 2, 3];
}

But I really don't understand this one:
class X {
  // Inferred as List<dynamic>.
  List ints = <int>[];
}

Just wanted to bump this for possible priority in the next breaking release (Dart3?). I've been migrating large swaths of Dart 1 code to be compatible with Dart 2 semantics and answering questions from newbies on Stack Overflow (re: Flutter).
There is a lot of accidental dynanicism due to this pattern:
Map map = {'hello': 'world'};

User expectation is that this infers a Map<String, String>, but it doesn't, ironically it would have if they wrote var or final on the LHS instead of the type annotation.
I think we should probably make it infer by default (i.e. treat the LHS Map sort of like Java's Map<>) - you can write <dynamic, dynamic>{'hello': 'world'} if you really meant that.
It's possible to write an effective lint for this in the mean time, I assume.

Partial inference on type annotations could be added to the language (that would, e.g., let List denote the type List<int> in the declaration List xs = <int>[];).
I usually argue that it is too error-prone to use inference in the middle of a type annotation, and we should hence require some syntactic marker (e.g., List<> xs = ..;), so I'd like to keep the possibility on the radar that maybe we won't add it to the language.
In that case it can be addressed right now, in tools: Use var xs = e; if you want inference based on e; use Iterable<int> xs = e if you want the type annotation Iterable<int>; using Iterable xs = e; means the same thing as Iterable<dynamic> xs = e; (and in general we use instantiate-to-bound to find missing type arguments where inference does not apply), and --no-implicit-dynamic could be adjusted to flag it.

@Hixie out of curiosity, what is your reason to use LinkedHashSet x = ... instead of var x = ... or final x = ...,
and how common do you think that your form is preferred over var/final?

I commented on #32634, but I don't think:

LinkedHashSet x = new Set<int>()

... should be a static (or runtime) error, it's valid to assign a LinkedHashSet<int> to a LinkedHashSet<dynamic>. It looks like the CFE/Kernel process thinks that new Set must create a type of Set, but it doesn't since new Set is a redirecting factory constructor to LinkedHashSet.
@zoechi:

@Hixie out of curiosity, what is your reason to use LinkedHashSet x = ... instead of var x = ... or final x = ...,
and how common do you think that your form is preferred over var/final?

Regardless of preference, a lot of former Java programmers will write stuff like Map x = {1: 2}, not knowing this accidentally untypes the collection - in Java it's common to write Map<> and have the generics filled in, where in Dart they are always filled in as dynamic (hence this issue - I think we should change this behavior in Dart 3).

It is an error because it is not a downcast and not an upcast: Set<int> --> LinkedHashSet<int> --> LinkedHashSet<dynamic> goes down-then-up.
Of course, if we add partial inference on type annotations then LinkedHashSet in the type annotation would mean LinkedHashSet<int>, and it would then be a plain downcast.
And I still think it would be error-prone to allow partial type annotation inference with exactly the same syntax as instantiate-to-bound, but requesting it with LinkedHashSet<> x = ...; is much better.

@zoechi I wanted to be clear that I was creating a LinkedHashSet, not just a HashSet, because the order of nodes in the set matters. I didn't, however, want to repeat the type arguments, which were (in the original code) an abomination of multiple levels of nested types. A typedef that lets me define type aliases with generics would have solved my problem as well.
In practice this was not code I would actually ship, it was just experimental code. In Flutter's codebase, we'd put all the types on both sides. But it would not surprise me to see our developers writing this kind of code, and the fact that it fails today is very sad (and a regression from Dart1).

I wanted to be clear that I was creating a LinkedHashSet, not just a HashSet

LinkedHashSet x = new LinkedHashSet<int>();

I still have troubles to make sense of that request.
I'd assume that one either wants to write the type on the left or on the right.
I can even understand that some want to be extra explicit and add the type on both sides,
but what I struggle with is your example where the base type is set left, but the generic type on the right.
I'd either write
``’
var x = new LinkedHashSet();
or

LinkedHashSet x = new LinkedHashSet();
or if this works (only on the phone - not tested)

LinkedHashSet x = new Set();
as I understood from above comments the runtime type should have the generuc type from the left side in the later 2 examples.

I like to put the type on the constructor call because that's the one that "matters", in terms of it being the actual place the type is being used. The variable is just a name for a piece of memory, the constructor is actually doing the allocation, calling the code, etc.
I like to use Set rather than LinkedHashSet because it's the closest thing to a Set literal, which is what I actually want to use. The same problem (analyzer and compiler errors) would occur with map:
LinkedHashMap x = <int, String>{};

The original question in this issue has been answered and we have a solution to avoid the problem raised. See https://github.com/dart-lang/sdk/issues/33119

authors: Hixie eernstg matanlurey natebosch zoechi


text:
Remove the localhost security restriction for VMService connections

If someone runs the VM disabling the security token we should continue to enforce the localhost restriction.
When the security token is in place, the localhost check serves no purpose and just blocks users from convenient use cases.

Authentication codes aren't an alternative solution to the existing origin check as they provide different protections against malicious connections. AFAIK, we don't have any plan to remove the origin check as there's a way for users to disable it for convenience.


text:
Assist adds missing case clauses for a switch at wrong position

If the '{ }' are in the same line, it will add the case clauses too high, even above the switch():

If I put enter between '{' and '}' it works as expected:

This is still an issue.


text:
Cannot infer generic class when calling generic method from generic method

Hello! I am having some problems with flutter and this is probably related to dart.

Steps to Reproduce

Run flutter create bug.
Copy paste the following code inside main.dart

abstract class Bar {
}

class Foo extends Bar {
}

class SomeClass {
  T doSomething<T>() {
    return AnotherClass.doSomething();
  }
}

class AnotherClass {
  static T doSomething<T extends Bar>() {
    print(T);
    return null;
  }
}

Call

Foo bar = SomeClass().doSomething();

Expected results:
I/flutter (16374): Foo
Actual results:
I/flutter (16374): Null

Logs

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale en)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.6)
[✓] Connected device (2 available)

• No issues found!

It seems it works normally when I switch the
static T doSomething<T extends Bar>() {
  print(T);
  return null;
}

for
static T doSomething<T>() {
  print(T);
  return null;
}

Is this the intended behaviour?
I noticed this behaviour occurs when one of the methods has the generic class extending another class, doesn't matter the order the functions are called.

Try this:
class SomeClass {
  T doSomething<T extends Bar>() {
    return AnotherClass.doSomething();
  }
}

This makes it possible for the inference step to find a type (namely T) which will satisfy the bound on the AnotherClass.doSomething.

yeah @eernstg this solves the problem but I need to access the AnotherClass.doSomething from both
class SomeClass {
  T doSomething<T>() {
    return AnotherClass.doSomething();
  }
}

and
class OtherClass {
  T doSomething<T extends Bar>() {
    return AnotherClass.doSomething();
  }
}

If you call AnotherClass.doSomething<T>() where T doesn't satisfy the constraint (T extends Bar), as in SomeClass.doSomething then you simply have a compile-time error. Type inference won't use T as the type argument when it is a compile-time error, and that's the reason why you get Null (which is a subtype of the bound, until you enable null-safety).
At run time, AnotherClass.doSomething might rely on T being a subtype of Bar, so it's simply unsafe to call it with a type argument that violates the bound.
You can still do it dynamically, and pay the price that it might fail at run time:
class SomeClass {
  T doSomething<T>() {
    return (AnotherClass.doSomething as Function)<T>();
  }
}

But the statically safe approach where you have T extends Bar also in SomeClass is of course preferable, if possible.

Ohh it worked as expected!
I'm doing some type checks before calling function, no problem if this breaks at runtime as I'm handling errors at some point.
What I'm doing is checking if T is a known type (String, int, etc) and in last case it will try to use do AnotherClass.doSomething.
I tried using
T is Bar
T == Bar

but the result is always false, even if T does subclass Bar.
I think this happens due to flutter/dart not supporting Mirroring, though?

If you want to check whether T is a subtype of Bar you can do <T>[] is List<Bar>.
Checking T is Bar is always false because T evaluates to an instance of Type that reifies the value of T, and Type is not a subtype of Bar. T == Bar is tricky (comparison of reified types for equality contains all kinds of twists), but it will evaluate to true when T is actually Bar (and false in other cases, including the case where T is a subtype of Bar which is not Bar itself).
There is no need for mirrors in order to check this, but you do pay at run time for the creation of an empty list if you use <T>[] is List<Bar>.

It seems it worked!!! Thank you very much!

authors: eernstg marcosmko


text:
[vm] occasional GC/allocator assertion failures on try bots

I'm occasionally seeing the following gc assertion error show up on try bots with the flag flip CL:
cc @a-siva @rmacnak-google @mraleph
stderr:
../../runtime/vm/heap/pages.cc: 1453: error: expected: donor->freelists_[i].top() == 0
version=2.12.0-edge.91815705131aee07b5a1793e483e8fc990c0338b (be) (Wed Oct 28 14:01:57 2020 +0000) on "linux_x64"
pid=16571, thread=16580, isolate_group=main(0x5596d4f38580), isolate=(nil)((nil))
isolate_instructions=7f621b969000, vm_instructions=5596d2a57f40
  pc 0x00005596d2e52e7c fp 0x00007f621927e8c0 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x00005596d2a58072 fp 0x00007f621927e9a0 dart::Assert::Fail(char const*, ...)+0x82
  pc 0x00005596d2f5db7c fp 0x00007f621927e9f0 dart::PageSpace::MergeFrom(dart::PageSpace*)+0x46c
  pc 0x00005596d2f4fd84 fp 0x00007f621927ea30 dart::Heap::MergeFrom(dart::Heap*)+0x54
  pc 0x00005596d33df88a fp 0x00007f621927ea90 out/DebugX64/dart+0x243288a
  pc 0x00005596d2d0bd99 fp 0x00007f621927ead0 dart::IsolateGroup::RunWithLockedGroup(std::__2::function<void ()>)+0x49
  pc 0x00005596d33b851b fp 0x00007f621927ec10 dart::CreateWithinExistingIsolateGroup(dart::IsolateGroup*, char const*, char**)+0x65b
  pc 0x00005596d2bfee25 fp 0x00007f621927ec90 out/DebugX64/dart+0x1c51e25
  pc 0x00005596d2f16b8b fp 0x00007f621927ed30 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x1cb
  pc 0x00005596d2f175c9 fp 0x00007f621927ed80 dart::ThreadPool::Worker::Main(unsigned long)+0x179
  pc 0x00005596d2e4bc39 fp 0x00007f621927eed0 out/DebugX64/dart+0x1e9ec39
-- End of DumpStackTrace

Do you remember which configurations this was showing up in (JIT, AOT, ARM, x64 etc.) ?

As mentioned on the original bug, this can safely be approved/ignored. Our lightweight isolate work in JIT is in-progress - those tests are explicitly opting into this experimental / not-yet-ready support.
We could skip those tests in JIT mode for the time being, if we find it causing too much noise

Thanks!  Sorry for the noise, I'll close this out.

authors: a-siva leafpetersen mkustermann


text:
Unable to infer base type using is on Dart SDK 2.12.0

I am getting this error The getter 'loadFromNetwork' isn't defined for the type 'Event & LoadEvent'.
Before Flutter 2 and Dart Latest this wasn't an issue with is check it was able to infer types from base classes.
Dart Version
Dart SDK version: 2.12.0 (stable) (Thu Feb 25 19:50:53 2021 +0100) on "windows_x64"
Steps to Reproduce
Here is an example snippet identical to our code.
import 'package:flutter/material.dart';
abstract class Base{
  String get eventType;
  int get originator;
  // other data
}
abstract class NetworkLoadEvent extends Base {
  bool get loadFromNetwork;
  bool get showLoading;
  bool get showToast;
  String get toastMessage;
}

abstract class BaseEventClass<
  Event extends Base,
  LoadEvent extends NetworkLoadEvent>{

  @protected
  void mapEventToState(
    Event event,
  ) {
    if (event is LoadEvent) {
      // event.loadFromNetwork is error
     // The getter 'loadFromNetwork' isn't defined for the type 'Event & LoadEvent'.
      if (event.loadFromNetwork) {
        // load from network
      }
    }
  }

  @protected
  void doSomething(LoadEvent e){
    // more work
  }

  @protected
  void doSomethingMore(LoadEvent e);
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Center(
        child: Container(
          child: Text('Hello world'),
        ),
      ),
    );
  }
}

Future<void> main() async {
  runApp(MyApp());
}

Expected results:
Should infer the types automatically like it did before Flutter 2.0
Actual results:
The getter 'loadFromNetwork' isn't defined for the type 'Event & LoadEvent'. Try importing the library that defines 'loadFromNetwork', correcting the name to the name of an existing getter, or defining a getter or field named 'loadFromNetwork'.
Current Solution
Cast using as  (event as LoadEvent).loadFromNetwork but this gives two lint errors of  avoid_as and unnecessary_cast. It's a round-around solution but any solution from flutter like it used to work before 2.0 would be better.

Flutter analyze
The getter 'loadFromNetwork' isn't defined for the type 'Event & LoadEvent'. Try importing the library that defines 'loadFromNetwork', correcting the name to the name of an existing getter, or defining a getter or field named 'loadFromNetwork'

Flutter doctor verbose
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.19042.685], locale en-US)
    • Flutter version 2.0.1 at N:\Wazo\Projects\flutter\flutter_windows_v0.5.1-beta\flutter
    • Framework revision c5a4b4029c (4 days ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at O:\Programs\Android
    • Platform android-30, build-tools 29.0.0
    • ANDROID_HOME = O:\Programs\Android
    • Java binary at: O:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

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

[√] Android Studio (version 4.1.0)
    • Android Studio at O:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.54.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.20.0

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.190
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 88.0.705.81

! Doctor found issues in 1 category.

Yes, the analysis looks right to me, this is a bug in the analyzer.

https://dart-review.googlesource.com/c/sdk/+/190730


text:
Dart and analyzer treat name conflict in the different ways

Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"
The following source code example should throw compile errors:
    class C {
      int s1 = 1;
      int s2 = 1;

      static set s1(var value) => throw "Should not reach here";
      static String s2() => throw "Should not reach here";
    }

    main() {}

It throws 2 compile errors with analyzer and 3 compile errors + 1 warning with dart.
So is this a correct result or both tools should produce the same?
There are two kinds of conflicts here, because two instance variables implicitly induce a getter and a setter, so we have the conflict specified in 'Class Member Conflicts' as well as a regular name clash.
Analyzer reports the 'Class Member Conflicts' error, and it seems reasonable to omit the plain name clashes. Sample output is:
    Analyzing test.dart...
      error - Class 'C' can't define static member 's1' and have instance member 'C.s1' with the same name. - test.dart:5:14 - conflicting_static_and_instance
      error - Class 'C' can't define static member 's2' and have instance member 'C.s2' with the same name. - test.dart:6:17 - conflicting_static_and_instance
    2 errors found.

With dart we get the plain name clash, and not the 'Class Member Conflicts' error for s1. For s2, this is again the plain name clash, although via the implicitly induced members. Sample output is:
    test.dart:6:17: Error: 's2' is already declared in this scope.
      static String s2() => throw "Should not reach here";
                    ^^
    test.dart:3:7: Context: Previous declaration of 's2'.
      int s2 = 1;
          ^^
    test.dart:5:14: Error: Conflicts with the implicit setter of the field 's1'.
      static set s1(var value) => throw "Should not reach here";
                 ^
    test.dart:2:7: Error: Conflicts with setter 's1'.
      int s1 = 1;
          ^

The question might be whether we expect the number of errors reported to be specified.
In this case we have a direct name clash because the instance variable declaration named s1 implicitly induces two declarations named s1 and s1=, and the static setter declaration has name s1=. At the same time, we have an error because the interface of C includes member signatures named s1 and s1=, and we have a static member s1=. The former error occurs because the instance variable is declared in C, but the latter error would also have occurred if the instance variable had been inherited. Those two errors are specified in different locations in the specification (here and here).

The front end seems to be more informative than the analyzer because it points out both declarations that are conflicting.
It's not internally consistent, though, since it uses Context for one and Error for another.

The presentation could be improved to make this more clear, but the front end isn't reporting two diagnostics. It's reporting a single diagnostic (labeled as 'Error') and one context message (labeled as 'Context'). A context message is additional information that is associated with, and provides context for the user to understand, a diagnostic.
In my opinion, it would be better if the context message were indented under the diagnostic in order to make the relationship more clear. It would also be better to not print 'Context' at all, and especially not in a way that makes it look like another level of severity.
But I agree, the analyzer really ought to also provide a context message in this case so that it's easier for users to locate the other declaration that's causing a conflict.

But it may seem overly formalistic to require that both of these errors are reported, because they're "about the same name clash" for anyone who isn't spending their time writing language tests. ;-)

In my mind it's less about being "formalistic" and more about providing the best UX possible. Rather than look at it in terms of how many places the code is violating the specification, I think we want to look at it in terms of how many things the user needs to change in order to bring the code into compliance with the specification. If an instance and static member conflict, then there's really only one problem that needs to be fixed (with several possible ways that the user might choose to fix it).

Do we have a partial order among all compile-time errors such that we can gather a set of errors that apply at a given location, and then just report the most "informative" one?

No. I'm not actually convinced that (a) we could come up with a partial order or (b) that if we did that it would be the case that the diagnostics that ought to be removed would always be reported at the same location as the "informative" one. It would be nice, though, if we could automate some of the process of eliminating follow-on diagnostics.

eliminating follow-on diagnostics

I'm not quite sure what that means, but I wasn't thinking about error propagation (that is, var x = 1 + true; is an error, and now print(x); could be an error, too). We very likely want to avoid reporting propagated errors, but they would be related by a chain of cause-and-effect, so there's no need for an ordering on the error messages themselves, we just suppress the emission of each cause-and-effect path immediately after one step, and that probably typically done by using a special InvalidType which doesn't cause errors when used, no matter how.
I was thinking about errors that arise independently at the same location (that probably needs to be at overlapping or nested char offset ranges). For instance, if an instance member has both a name clash and an incorrect-override error.
Do we generally want to report all of those, or just the one that has the highest priority in some sense?
And if we generally want to report all of them, why wouldn't we report both the plain name clash and the 'Class Member Conflicts' error in the original example in this issue?

The way I think of it (which might not be right) is that the spec describes two static errors because it needs to do so in order to be complete. But from a user's point of view there's only one problem: the name can't be used for both an instance member and a static member in the same class. The number of diagnostics should equal the number of problems, not the number of places in the spec where a static error is described.

I'm not quite sure what that means ...

I think of a follow-on diagnostic as a diagnostic for a problem that wouldn't exist if some different problem were fixed. But after thinking about this more, I don't think it's relevant because the probably isn't the kind of situation you were thinking about.

I was thinking about errors that arise independently at the same location ... For instance, if an instance member has both a name clash and an incorrect-override error.
Do we generally want to report all of those, or just the one that has the highest priority in some sense?

That's a little harder. If the user solves the name clash by renaming the instance member, then maybe there was only one problem. But if the user solves the name clash by renaming the static member, then it appears that there were two problems. Because we don't know which situation we're in we don't have enough information to make a perfect choice.
I suspect that we generally opt to report both diagnostics at that point, but there's no compelling reason that I can think of to do so.

authors: bwilkerson eernstg iarkh


text:
Add support to dart analyze for running with experiments

To support removing dartanalyzer in https://github.com/dart-lang/sdk/issues/48457.

I was able to land the --dart-sdk flag, but this one seems much more complicated to implement:
I think it involves adding a --enable-experiment flag to the analysis_server snapshot, which would get pushed through to Driver, to SocketServer, to AnalysisServer, to ContextManager, to the ContextCollection. Maybe not too hard if it is just stored in AnalysisServerOptions, as that gets shared all the way from Driver down to ContextManager.
CC @bwilkerson @scheglov for thoughts.

Yes, it's reasonable for those flags to be stored in the AnalysisServerOptions. I'd probably add the hooks for setting the values in AnalysisContextCollectionImpl and keep it out of the public API for now.

Yes, using AnalysisServerOptions looks good.
We already have the hook in AnalysisContextCollectionImpl, see updateAnalysisOptions and how it is used in analyzer_cli specifically for this purpose.

This should be complete.

authors: bwilkerson scheglov srawlins


text:
Analyzer trips up on super constructor parameters

This tracker is for issues related to:

Analyzer

platform
macOS
steps to reproduce

check out flutter
cd <flutter>
./bin/dart --enable-asserts dev/bots/analyze.dart

observed output
Unhandled exception:
Invalid argument(s): Content produced diagnostics when parsed:
  EXPECTED_TOKEN: Expected to find '}'. - 54:18

Example line that generates the EXPECTED_TOKEN error: https://github.com/flutter/flutter/blob/03be77dbf0315d32db5b0069637fbdb9cb2c91b5/packages/flutter/lib/src/foundation/diagnostics.dart#L2430
The analyzer is running with FeatureSet.fromEnableFlags2(sdkLanguageVersion: Version.parse('2.17.0-0'), flags: <String>['super-parameters']) so it seems related to super-parameters.

With flutter master, I have some different result on Windows 10:
C:\use\flutter> bin\dart --enable-asserts .\dev\bots\analyze.dart
...
Skip test comments...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
C:\use\flutter\dev\bots\test\prepare_package_test.dart:363: skip test without a justification comment.
C:\use\flutter\dev\bots\test\sdk_directory_has_space_test.dart:20: skip test without a justification comment.
...
...
C:\use\flutter\packages\flutter_tools\test\general.shard\macos\xcode_validator_test.dart:73: skip test without a justification comment.

See: https://github.com/flutter/flutter/wiki/Tree-hygiene#skipped-tests

Yea, it appears to work on linux too since flutter's CI runs it just fine.  For some reason, being on macOS seems key.

(Note: we recently added a 'no response' bot to our repo; it may have closed existing issues with the needs-info label incorrectly. If you think your issue was effected, please feel free to reopen the issue)

authors: asashour devoncarew gaaclarke


text:
Bug: Directory.watch() emits incorrect isDirectory

I've encountered a bug with the Directory.watch() function in Dart on Linux and Windows. When a directory is deleted, the function does emit a delete event as expected. However, the event.isDirectory property incorrectly returns false.
Steps to Reproduce
Here's a simple Dart program that reproduces the issue:
import 'dart:io';

main() {
  Directory('./').watch().listen((event) {
    print([event.type, event.isDirectory]);
  });
}

When you run this program and delete a directory in the current working directory, the console output indicates that event.isDirectory is false, which is not the expected behavior.
Expected Behavior
When a directory is deleted, I expect the event.isDirectory property of the delete event to be true.
Actual Behavior
The event.isDirectory property of the delete event is false when a directory is deleted.
Environment
Dart SDK Version: 3.3.0 (stable)
Operating System and version: Ubuntu 22.04.3 LTS, Windows 11 22H2

This is working working as intended - isDirectory is always false for FileSystemDeleteEvent. I have a PR in progress to clarify this:
https://dart-review.googlesource.com/c/sdk/+/357663

authors: IrisDAnte brianquinlan


text:
[JS-interop] Extension for JSBigint

Why JSBigint and Bigint have no extension in js-interop like

/// [JSBigInt] <-> [BigInt]
extension JSBigIntToBigInt on JSBigInt {
  external BigInt get toDart;
}

extension BigIntToJSBigInt on BigInt {
  external JSBigInt get toJS;
}

I try to create in my project these extensions but i have this error:
Error: Type 'BigInt' is not a valid type in the signature of `dart:js_interop` external APIs or APIs converted via `toJS`. The only valid types are: JS types from `dart:js_interop`, @staticInterop types, void, bool, num, double, int, String, extension types that erases to one of these types, or a type parameter that is bound to a static interop type.
[        ]  - 'BigInt' is from 'dart:core'.
[        ] Use one of the valid types instead.
[        ]   external BigInt get toDart;
[        ]                       ^
[        ] lib/main.dart:224:25: Error: JS interop or Native class required for 'external' extension members.
[        ] Try adding a JS interop annotation to the on type class of the extension.
[        ]   external JSBigInt get toJS;
[        ]                         ^

@redDwarf03 have you tried using js- like js: ^0.6.4 and creating an interop?
import 'package:js/js.dart';

@JS('BigInt')
class JSBigInt {
  external JSBigInt(String value);
  external JSBigInt add(JSBigInt other);
  external JSBigInt multiply(JSBigInt other);
}

class MyBigInt extends JSBigInt {
  MyBigInt(String value) : super(value);

  MyBigInt addWithDart(MyBigInt other) {
    return this.add(other);
  }

  MyBigInt multiplyWithDart(MyBigInt other) {
    return this.multiply(other);
  }
}

void main() {
  var a = MyBigInt('123456789123456789');
  var b = MyBigInt('987654321987654321');

  var resultAdd = a.addWithDart(b);
  var resultMultiply = a.multiplyWithDart(b);

  print('Addition Result: ${resultAdd.toString()}');
  print('Multiplication Result: ${resultMultiply.toString()}');
}

@redDwarf03 have you tried using js- like js: ^0.6.4 and creating an interop?
import 'package:js/js.dart';

@JS('BigInt')
class JSBigInt {
  external JSBigInt(String value);
  external JSBigInt add(JSBigInt other);
  external JSBigInt multiply(JSBigInt other);
}

class MyBigInt extends JSBigInt {
  MyBigInt(String value) : super(value);

  MyBigInt addWithDart(MyBigInt other) {
    return this.add(other);
  }

  MyBigInt multiplyWithDart(MyBigInt other) {
    return this.multiply(other);
  }
}

void main() {
  var a = MyBigInt('123456789123456789');
  var b = MyBigInt('987654321987654321');

  var resultAdd = a.addWithDart(b);
  var resultMultiply = a.multiplyWithDart(b);

  print('Addition Result: ${resultAdd.toString()}');
  print('Multiplication Result: ${resultMultiply.toString()}');
}

No because js is not supported with new JS Interoperability and WASM
https://dart.dev/interop/js-interop
So i don't want to use js. Sorry

I create this dart class based on dart test classes but i think dart core team should expose a method to manipulate Bigint and JSBigInt
import 'dart:js_interop';

@JS()
external JSBigInt bigInt;

@JS('BigInt')
external JSBigInt createBigInt(String value);

extension on JSBigInt {
  @JS('toString')
  external String toStringExternal();
}

Great request, @redDwarf03.

The toDart case is fairly straightforward:
JSBigInt b = ...;
BigInt b2 = BigInt.parse(b.toString()); // toString calls the external toString

The toJS case requires a few more lines but is also straightforward:
@JS('BigInt')
external JSBigInt bigInt(String s);

...

BigInt b = ...;
bigInt(b.toString());

Of course, it'd be useful to add functions that do this for you and have them in dart:js_interop, so we can track this request.

The same with JSFunction if possible :)

Can you elaborate a bit more here? We have Function.toJS and JSExportedDartFunction.toDart today. JSExportedDartFunction is a separate type since not all JSFunctions were converted Dart functions. If you want to call arbitrary JSFunctions, one solution is using JSFunction.callAsFunction.

thx. i will explore your comment on JSFunction

@srujzs about JSBigint and JSArray:
I have an JSArray
2 cases:
1 - I manage conversion directly in dart
@JS()
extension type WriteContractParameters._(JSObject _) implements JSObject {
  external WriteContractParameters({
    JSArray? args,
  });

  external JSArray? args;
}

@JS()
external JSBigInt bigInt;

@JS('BigInt')
external JSBigInt createBigInt(String value);

extension on JSBigInt {
  @JS('toString')
  external String toStringExternal();
}

final writeContractParameters = WriteContractParameters(
   args: [
       '0x08Bfc8BA9fD137Fb632F79548B150FE0Be493254'.toJS,
       createBigInt('498500000000000'),
   ].toJS,
);

When i debug javascript, i have my bigint correctly managed
args: Array(2)
0: "0x08Bfc8BA9fD137Fb632F79548B150FE0Be493254"
1: 498500000000000n

2 - I don't manage conversion directly in dart
class WriteContractParameters {
  WriteContractParameters({
    this.args,
  });

  List<dynamic>? args;

  JSWriteContractParameters get toJS => JSWriteContractParameters(
        args: args?.jsify() as JSArray<JSObject>?,
       );
}

final writeContractParameters = wagmi.WriteContractParameters(
   args: [
      '0x08Bfc8BA9fD137Fb632F79548B150FE0Be493254',
      BigInt.from(498500000000000),
    ],
);

When i debug javascript, i have my bigint NOT correctly managed
args:
Array(2)
0: "0x08Bfc8BA9fD137Fb632F79548B150FE0Be493254"
1: core._BigIntImpl.__ {Symbol(_used): 4, Symbol(_digits): Uint16Array(4), Symbol(_isNegative): false}
length: 2
Symbol(dartx.arrayRti): (...)
Symbol(dartx.first): (...)
Symbol(dartx.hashCode): (...)
Symbol(dartx.isEmpty): (...)
Symbol(dartx.isNotEmpty): (...)
Symbol(dartx.iterator): (...)
Symbol(dartx.last): (...)
Symbol(dartx.length): (...)
Symbol(dartx.reversed): (...)
Symbol(dartx.runtimeType): (...)
Symbol(dartx.single): (...)
[[Prototype]]: Array(0)

So i would like to fix my case 2

Yeah, we currently don't treat BigInts specially in jsify and treat them as other Dart members, so it'll be a bit more of a manual process. There's a blanket bug here: https://github.com/dart-lang/sdk/issues/55222 to be clear about what jsify/dartify can and can't do (right now we only technically support whatever's in the doc comment) as well as make it consistent. One of the options there is allow users to have the conversion methods they need so they can write their own variants that convert types as they need.

@srujzs
i tried something like that but the add method seems to add nothing...

  JSArray<JSObject>? _convertArgs(List<dynamic>? args) {
    if (args == null) {
      return null;
    }
    final jsArgs = JSArray<JSObject>();
    for (final arg in args) {
      if (arg is String) {
        jsArgs.add(arg.toJS);
      } else if (arg is int) {
        jsArgs.add(arg.toJS);
      } else if (arg is bool) {
        jsArgs.add(arg.toJS);
      }
    }
    return jsArgs;
  }

@srujzs i tried something like that but the add method seems to add nothing...

  JSArray<JSObject>? _convertArgs(List<dynamic>? args) {
    if (args == null) {
      return null;
    }
    final jsArgs = JSArray<JSObject>();
    for (final arg in args) {
      if (arg is String) {
        jsArgs.add(arg.toJS);
      } else if (arg is int) {
        jsArgs.add(arg.toJS);
      } else if (arg is bool) {
        jsArgs.add(arg.toJS);
      }
    }
    return jsArgs;
  }

@srujzs is it possible to add BigInt in the condition https://github.com/dart-lang/sdk/blob/ee0b971dbd6ff51d8ec740294fb0a2730df6bb2b/sdk/lib/_internal/wasm/lib/js_util_patch.dart#L32

i tried something like that but the add method seems to add nothing...

There's no add method on a JSArray. You may want push e.g.
extension JSArrayExtension<T extends JSAny?> on JSArray<T> {
  external void push(T _);
}

Besides that, the approach seems fine, but it is a bit of reinventing jsify alas.

is it possible to add BigInt in the condition

One of the things we want to do for jsify/dartify is expose it in such a way that users can define their own conversions if needed. Maybe a callback would be useful here for types that aren't supported by default, but it'd be nice to customize jsify/dartify as needed.

authors: kaumudpa kevmoo redDwarf03 srujzs