leaphy-robotics / leaphy-client

Web-based client application for programming Leaphy robots
GNU General Public License v3.0
6 stars 7 forks source link

Breaks when offline #255

Open Vosjedev opened 9 months ago

Vosjedev commented 9 months ago

Describe the bug A lot of things use internet while running, but everything breaks when offline. The log trows all kind off errors from arduino-cli.

To Reproduce Steps to reproduce the behavior:

  1. Disable your internet
  2. Run and look at yarn start's output.

Expected behavior A lot more caching should be done, and for a fact, arduino already caches a lot. For some reason certain items in the cache get deleted at startup when trying to redownload all already downloaded files.

Desktop:

Additional context An example error:

18:05:17.822 › Verify Installation command received
Error: Command failed: /SD/workbench/eazybloqs/lib/linux/arduino_cli/arduino-cli core update-index --config-file /home/vosje/.config/Leaphy easybloqs/arduino-cli.yaml
Error updating index: Error downloading index 'https://downloads.arduino.cc/packages/package_index.json': Get "https://downloads.arduino.cc/packages/package_index.json": dial tcp: lookup downloads.arduino.cc: Temporary failure in name resolution

    at ChildProcess.exithandler (node:child_process:406:12)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:390:28)
    at Pipe.<anonymous> (node:net:687:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: '/SD/workbench/eazybloqs/lib/linux/arduino_cli/arduino-cli core update-index --config-file /home/vosje/.config/Leaphy easybloqs/arduino-cli.yaml',
  stdout: '',
  stderr: `Error updating index: Error downloading index 'https://downloads.arduino.cc/packages/package_index.json': Get "https://downloads.arduino.cc/packages/package_index.json": dial tcp: lookup downloads.arduino.cc: Temporary failure in name resolution\n`
}

but errors also trow at compiling. I haven't found any other places yet.

I have tried just disabling lib and core downloads if the index download commands fail, but to fully fix this, more needs to be done than I am able to (I have no experience with JS), so I can't fix this, sorry. I will try to do my best, but while writing this, some of my limits are reached...