Skip to content

clients receive completed: true twice when compiling with the grpc interface #2711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
dankeboy36 opened this issue Sep 28, 2024 · 0 comments · Fixed by #2731
Closed
3 tasks done

clients receive completed: true twice when compiling with the grpc interface #2711

dankeboy36 opened this issue Sep 28, 2024 · 0 comments · Fixed by #2731
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project

Comments

@dankeboy36
Copy link
Contributor

dankeboy36 commented Sep 28, 2024

Describe the problem

The CLI reports completed: true twice when compiling via the grpc API

{
  "progress": {
    "percent": 92.592606
  }
}
{
  "progress": {
    "percent": 96.29631
  }
}
{
  "progress": {
    "completed": true,
    "percent": 100.000015
  }
}
{
  "progress": {
    "completed": true,
    "percent": 103.70372
  }
}

To reproduce

Open a terminal:

./arduino-cli daemon
Daemon is now listening on 127.0.0.1:50051
{"IP":"127.0.0.1","Port":"50051"}

In another terminal:

tree my_sketch             
my_sketch
└── my_sketch.ino

1 directory, 1 file
cat my_sketch/my_sketch.ino
void setup() {}
void loop() {}
grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Create
{
  "instance": {
    "id": 1
  }
}
grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  -d '{"instance": {"id": 1}}' \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Init
grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  -d '{"instance": {"id": 1}, "fqbn": "arduino:avr:diecimila", "sketchPath": "./my_sketch/my_sketch.ino"}' \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Compile
{
  "progress": {
    "percent": 3.7037036
  }
}
{
  "progress": {
    "percent": 7.4074073
  }
}
{
  "progress": {
    "percent": 11.111111
  }
}
{
  "progress": {
    "percent": 14.814815
  }
}
{
  "progress": {
    "percent": 18.518518
  }
}
{
  "progress": {
    "percent": 22.222221
  }
}
{
  "progress": {
    "percent": 25.925924
  }
}
{
  "progress": {
    "percent": 29.629627
  }
}
{
  "progress": {
    "percent": 29.629627
  }
}
{
  "progress": {
    "percent": 33.333332
  }
}
{
  "progress": {
    "percent": 37.037037
  }
}
{
  "progress": {
    "percent": 40.74074
  }
}
{
  "progress": {
    "percent": 44.444447
  }
}
{
  "progress": {
    "percent": 48.14815
  }
}
{
  "progress": {
    "percent": 51.851856
  }
}
{
  "progress": {
    "percent": 55.55556
  }
}
{
  "progress": {
    "percent": 59.259266
  }
}
{
  "progress": {
    "percent": 62.96297
  }
}
{
  "progress": {
    "percent": 66.66667
  }
}
{
  "progress": {
    "percent": 70.37038
  }
}
{
  "progress": {
    "percent": 74.07408
  }
}
{
  "progress": {
    "percent": 77.77779
  }
}
{
  "progress": {
    "percent": 81.48149
  }
}
{
  "progress": {
    "percent": 85.185196
  }
}
{
  "progress": {
    "percent": 88.8889
  }
}
{
  "progress": {
    "percent": 92.592606
  }
}
{
  "progress": {
    "percent": 96.29631
  }
}
{
  "progress": {
    "completed": true,
    "percent": 100.000015
  }
}
{
  "progress": {
    "completed": true,
    "percent": 103.70372
  }
}
{
  "outStream": "U2tldGNoIHVzZXMgNDQ0IGJ5dGVzICgxJSkgb2YgcHJvZ3JhbSBzdG9yYWdlIHNwYWNlLiBNYXhpbXVtIGlzIDMwNzIwIGJ5dGVzLgpHbG9iYWwgdmFyaWFibGVzIHVzZSA5IGJ5dGVzICgwJSkgb2YgZHluYW1pYyBtZW1vcnksIGxlYXZpbmcgMjAzOSBieXRlcyBmb3IgbG9jYWwgdmFyaWFibGVzLiBNYXhpbXVtIGlzIDIwNDggYnl0ZXMuCg=="
}
{
  "result": {
    // removed
  }
}

Expected behavior

Clients receive completed: true once. When completed: true, then percent is 100.

Arduino CLI version

arduino-cli Version: git-snapshot Commit: 863c1ec Date: 2024-09-28T07:43:10Z

Operating system

macOS

Operating system version

11.7.10

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@dankeboy36 dankeboy36 added the type: imperfection Perceived defect in any part of project label Sep 28, 2024
@per1234 per1234 added topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface labels Oct 5, 2024
@cmaglie cmaglie self-assigned this Oct 10, 2024
@cmaglie cmaglie added the conclusion: resolved Issue was resolved label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants