You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IPC handlers on webContents.ipc not unwrapped properly #324
It looks like devtron is not properly unwrapping ipc handlers bound on webContents.ipc this gist https://github.com/proxy/gist.github.com/wbgsupport/8cb6257df3c50804675f8de6f0f7f73c reproduces the issue. All events show in devtron as expected but when the request reaches the handler it's not unwrapped. Using the gist the example output is shown in the console.
I investigated this and it looks like the issue is related to how Devtron patches IPC handlers.
In patchIpcMain() Devtron monkey-patches ipcMain.on, ipcMain.handle, etc., and wraps listeners to unwrap custom payloads using getArgsFromPayload().
However, webContents.ipc handlers are not patched there.
Tracking still works because Devtron listens to internal session events (-ipc-message, -ipc-invoke, etc.), but the unwrapping logic is only applied when handlers are registered via ipcMain.
When using webContents.ipc.handle or webContents.ipc.on, the listener does not go through Devtron’s cleanedListener, so the wrapped payload ({ __uuid__devtron, args }) reaches the user handler directly.
It seems Devtron would also need to patch webContents.ipc methods similarly to how ipcMain is patched, likely by hooking into browser-window-created and wrapping webContents.ipc methods.
Happy to attempt a PR if this direction makes sense.
Might be best to hook into web-contents-created rather than browser-window-created as that would catch BrowserContentView instances as well not just BrowserWindow. Regardless that's the conclusion I came to as well it's simply not running through the cleaned listener.
Activity
mossae commentedon Feb 17, 2026
I investigated this and it looks like the issue is related to how Devtron patches IPC handlers.
In patchIpcMain() Devtron monkey-patches ipcMain.on, ipcMain.handle, etc., and wraps listeners to unwrap custom payloads using getArgsFromPayload().
However, webContents.ipc handlers are not patched there.
Tracking still works because Devtron listens to internal session events (-ipc-message, -ipc-invoke, etc.), but the unwrapping logic is only applied when handlers are registered via ipcMain.
When using webContents.ipc.handle or webContents.ipc.on, the listener does not go through Devtron’s cleanedListener, so the wrapped payload ({ __uuid__devtron, args }) reaches the user handler directly.
It seems Devtron would also need to patch webContents.ipc methods similarly to how ipcMain is patched, likely by hooking into browser-window-created and wrapping webContents.ipc methods.
Happy to attempt a PR if this direction makes sense.
UndefinedOffset commentedon Feb 18, 2026
Might be best to hook into web-contents-created rather than
browser-window-createdas that would catchBrowserContentViewinstances as well not justBrowserWindow. Regardless that's the conclusion I came to as well it's simply not running through the cleaned listener.