Skip to content
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

The default preference value generated for arduino.ide.updateChannel never worked #2157

Open
3 tasks done
kittaakos opened this issue Jul 31, 2023 · 0 comments
Open
3 tasks done
Labels
topic: code Related to content of the project itself topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Jul 31, 2023

Describe the problem

The default preference value is 'stable':

In the IDE2 packager code, the default preference value of the electron-updater channel is overridden with a generated one at packaging time.

The packager logic calculates the output channel name here:

const updateChannel = getChannel();

It is 'stable' for release builds and 'nightly' for the nightly builds. Otherwise, it's omitted.

However, the generated default update channel property is merged into an incorrect location. It's put under theia.frontend.config:

'arduino.ide.updateChannel': updateChannel,

Output from the 2.1.1 release:

cat /Applications/Arduino\ IDE\ 2.1.1.app/Contents/Resources/app/package.json | jq '.theia.frontend.config'
{
  "applicationName": "Arduino IDE",
  "defaultTheme": {
    "light": "arduino-theme",
    "dark": "arduino-theme-dark"
  },
  "validatePreferencesSchema": false,
  "preferences": {
    "window.title": "${rootName}${activeEditorShort}${appName}",
    "files.autoSave": "afterDelay",
    "editor.minimap.enabled": false,
    "editor.tabSize": 2,
    "editor.scrollBeyondLastLine": false,
    "editor.quickSuggestions": {
      "other": false,
      "comments": false,
      "strings": false
    },
    "editor.maxTokenizationLineLength": 500,
    "editor.bracketPairColorization.enabled": false,
    "breadcrumbs.enabled": false,
    "workbench.tree.renderIndentGuides": "none",
    "explorer.compactFolders": false
  },
  "arduino.ide.updateChannel": "stable",
  "buildDate": "2023-06-30T16:00:43.829Z"
}

The generated "arduino.ide.updateChannel": "stable", entry must be under theia.frontend.config.preferences. Otherwise, it has no effect. See eclipse-theia/theia#4766. Since the default preference value of the update channel is 'stable' the incorrect default preference value does not change anything in release and snapshot builds.

For the nightly, it's also broken:

cat ~/Desktop/Arduino\ IDE\.app/Contents/Resources/app/package.json | jq '.theia.frontend.config' 
{
  "applicationName": "Arduino IDE",
  "defaultTheme": {
    "light": "arduino-theme",
    "dark": "arduino-theme-dark"
  },
  "defaultIconTheme": "none",
  "validatePreferencesSchema": false,
  "preferences": {
    "window.title": "${rootName}${activeEditorShort}${appName}",
    "files.autoSave": "afterDelay",
    "editor.minimap.enabled": false,
    "editor.tabSize": 2,
    "editor.scrollBeyondLastLine": false,
    "editor.quickSuggestions": {
      "other": false,
      "comments": false,
      "strings": false
    },
    "editor.maxTokenizationLineLength": 500,
    "editor.bracketPairColorization.enabled": false,
    "breadcrumbs.enabled": false,
    "workbench.tree.renderIndentGuides": "none",
    "explorer.compactFolders": false
  },
  "arduino.ide.updateChannel": "nightly",
  "buildDate": "2023-07-31T03:04:11.024Z"
}

If I understand the intentions here, IDE2 wants to promote the 'nightly' update site for nightly builds and the 'stable' otherwise.

  • this won't work if the user explicitly sets any values for arduino.ide.updateChannel in ~/.arduinoIDE/settings.json.
  • this won't work because IDE2 generates the default preference value to an incorrect location.

To reproduce

See the issue description.

Expected behavior

I don't know the intentions, but it doesn't work now.

Arduino IDE version

2023-07-31T03:04:11.024Z

Operating system

macOS

Operating system version

13.4.1

Additional context

#2144 will drop the invalid generation.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@kittaakos kittaakos added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Jul 31, 2023
@kittaakos kittaakos added the topic: code Related to content of the project itself label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant