mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-07 11:48:29 +08:00
tweak(action-bridge): Always process.nextTick inbound IPC events, see comment
This commit is contained in:
parent
e4494990a9
commit
1e705b9fb1
1 changed files with 19 additions and 11 deletions
|
@ -66,6 +66,14 @@ class ActionBridge
|
|||
Actions[name].listen(callback, @)
|
||||
|
||||
onIPCMessage: (initiatorId, name, json) =>
|
||||
# There's something very strange about IPC event handlers. The ReactRemoteParent
|
||||
# threw React exceptions when calling setState from an IPC callback, and the debugger
|
||||
# often refuses to stop at breakpoints immediately inside IPC callbacks.
|
||||
|
||||
# These issues go away when you add a process.nextTick. So here's that.
|
||||
# I believe this resolves issues like https://sentry.nylas.com/sentry/edgehill/group/2735/,
|
||||
# which are React exceptions in a direct stack (no next ticks) from an IPC event.
|
||||
process.nextTick =>
|
||||
console.debug(printToConsole, "ActionBridge: #{@initiatorId} Action Bridge Received: #{name}")
|
||||
|
||||
args = Utils.deserializeRegisteredObjects(json)
|
||||
|
|
Loading…
Add table
Reference in a new issue