Repository navigation
Closed
Description
Issue Details
- Electron Version:
- 11.0.3
- Operating System:
- Windows 10
- Last Known Working Electron version:
Expected Behavior
An invalid entry to the JumpList does not cause other entries to disappear.
Actual Behavior
A single invalid JumpList entry makes all other entries disappear.
To Reproduce
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
app.setJumpList([
{
type: "custom",
name: "Recent Workspaces",
items: [
{
type: "task",
title: "Title",
description: "Description",
program: process.execPath
},
{
type: "task",
title: "Long Title",
description: "DescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescriptionDescription",
program: process.execPath
}
]
}
])
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.Additional Information
It looks like this happens when the description property exceeds 255 characters length?
Activity
zg3d commentedon Dec 11, 2020
Could I try to contribute to this issue.
codebytere commentedon Dec 12, 2020
hey @zg3d - sure! i'd be happy to give you some pointers. So what's happening here is that is looks like when the SetDescription method is called with a too-long parameter, it causes the
IShellLinkto not show up.SetJumpListis implemented here, which in turn invokes methods from this file. I'd start by digging into this line.MarcoDotIO commentedon Jan 2, 2021
Hi there,
I'm a complete beginner for developing on the Electron platform. Do you guys have any resources for getting started with solving issues with this type of platform?
ankushduacodes commentedon Jan 22, 2021
Hi @codebytere, I would love to work on this issue if no one is.
Please let me know if I may.
Thank you!... 🚀
rohit306-bit commentedon Feb 1, 2021
i also wants to try to fix it
codebytere commentedon Feb 1, 2021
As this is an open source project, you do not need my permission to work on available issues :)
HiMyNameIsBennet commentedon Mar 31, 2021
Hello! I'm a first time contributor, and trying my hands at this issue. I see the "LOG" function being called a lot, to, probably, log errors and warnings into a file somewhere, but I couldn't find out how to access these logs/where they are saved. Could someone give me a pointer on this?
erickzhao commentedon Mar 31, 2021
@SushiJackal the
LOGfunctions are inherited from Chromium: https://chromium.googlesource.com/chromium/src/base/+/refs/heads/master/logging.hYou can enable these log messages with the
ELECTRON_ENABLE_LOGGINGenvironment variable.If you're building locally and testing your custom build with Electron Fiddle, there's a checkbox in the settings to enable it.
HiMyNameIsBennet commentedon Apr 1, 2021
After running some tests to determine the source of the issue, I've come to the conclusion that the
SetDescriptionfunction returnsS_OK, so 0, even if the description is too long to function as expected.Since this behaviour is part of a Windows function (as far as I can see), in my opinion the best solution would be to keep the if-statement checks intact (
FAILED(link->SetDescription...and such), and, after, check theitem.description.c_str()string against a predetermined maximum length (the above suggested 255?), returningfalseif it should exceed it, like what is done with theif-checks withinAppendTask. Would this be good practice? Is there a more elegant way?erickzhao commentedon Apr 1, 2021
@SushiJackal I'm personally unfamiliar with the code, but if you have a working fix, I'd suggest submitting a PR to show your solution and getting feedback there.