Description
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:
arduino-ide/electron/packager/config.js
Line 126 in 144df89
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/electron/packager/config.js
Line 134 in 144df89
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