<p dir="auto">This seemed to have started recently, but I'm not sure which version of electron exactly. I've reproduced it on 0.36.4 and 0.36.5.</p>
<p dir="auto">When sending an object over ipc from the main process, additional references to the same object end up being null. The first 'instance' of that property on <code class="notranslate">state</code> makes it to the client, but any additional references end up null.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  const state = {}
  const object = { 'prop': 1 }

  state.firstReference = object
  state.brokenReference = object // brokenReference ends up null on the client

  win.webContents.on('did-finish-load', function() {
    console.log('sending state', state)
    win.webContents.send('update', state)
  });"><pre class="notranslate">  <span class="pl-k">const</span> <span class="pl-s1">state</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
  <span class="pl-k">const</span> <span class="pl-s1">object</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'prop'</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span>

  <span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">firstReference</span> <span class="pl-c1">=</span> <span class="pl-s1">object</span>
  <span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">brokenReference</span> <span class="pl-c1">=</span> <span class="pl-s1">object</span> <span class="pl-c">// brokenReference ends up null on the client</span>

  <span class="pl-s1">win</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'did-finish-load'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'sending state'</span><span class="pl-kos">,</span> <span class="pl-s1">state</span><span class="pl-kos">)</span>
    <span class="pl-s1">win</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">send</span><span class="pl-kos">(</span><span class="pl-s">'update'</span><span class="pl-kos">,</span> <span class="pl-s1">state</span><span class="pl-kos">)</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Here's a repo that reproduces this:<br>
<a href="https://github.com/bmathews/electron-ipc-bug">https://github.com/bmathews/electron-ipc-bug</a></p>
<p dir="auto">I came across a very interesting scenario. There was some missing information in a collection that I sent between two processes.</p>
<p dir="auto">Assume the scenario, Renderer and Process.</p>
<p dir="auto">If I have an array that contains multiple entries of the <strong>same object reference</strong>, only the <strong>first object</strong> will be provided to the receiving side of the message -- the other entries will be <code class="notranslate">null</code>.</p>
<h4 dir="auto">Renderer</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {ipcRenderer} from 'electron';
var theObject = {foo: 'bar'};
var theList = [theObject, theObject, theObject];
ipcRenderer.send('test', theList);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">ipcRenderer</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'electron'</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">theObject</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-c1">foo</span>: <span class="pl-s">'bar'</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">theList</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s1">theObject</span><span class="pl-kos">,</span> <span class="pl-s1">theObject</span><span class="pl-kos">,</span> <span class="pl-s1">theObject</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-s1">ipcRenderer</span><span class="pl-kos">.</span><span class="pl-en">send</span><span class="pl-kos">(</span><span class="pl-s">'test'</span><span class="pl-kos">,</span> <span class="pl-s1">theList</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h4 dir="auto">Main Process</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {ipcMain} from 'electron';

ipcMain.on('test', (evt, data) =&gt; {
  console.log(data);
  // this will output [{foo: 'bar'}, null, null];
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">ipcMain</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'electron'</span><span class="pl-kos">;</span>

<span class="pl-s1">ipcMain</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'test'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">evt</span><span class="pl-kos">,</span> <span class="pl-s1">data</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-c">// this will output [{foo: 'bar'}, null, null];</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<hr>
<p dir="auto">It is only when the object references are distinct from each other does the information remain intact. For example, If we do</p>
<h4 dir="auto">Renderer</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {ipcRenderer} from 'electron';
var theObject = {foo: 'bar'};
// create new object references for the other two entries, such that all entries are unique by reference
var theList = [theObject, {...theObject}, {...theObject}];
ipcRenderer.send('test', theList);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">ipcRenderer</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'electron'</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">theObject</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-c1">foo</span>: <span class="pl-s">'bar'</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-c">// create new object references for the other two entries, such that all entries are unique by reference</span>
<span class="pl-k">var</span> <span class="pl-s1">theList</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s1">theObject</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>...<span class="pl-s1">theObject</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>...<span class="pl-s1">theObject</span><span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-s1">ipcRenderer</span><span class="pl-kos">.</span><span class="pl-en">send</span><span class="pl-kos">(</span><span class="pl-s">'test'</span><span class="pl-kos">,</span> <span class="pl-s1">theList</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h4 dir="auto">Main Process</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {ipcMain} from 'electron';

ipcMain.on('test', (evt, data) =&gt; {
  console.log(data);
  // this will output [{foo: 'bar'}, {foo: 'bar'}, {foo: 'bar'}];
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">ipcMain</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'electron'</span><span class="pl-kos">;</span>

<span class="pl-s1">ipcMain</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'test'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">evt</span><span class="pl-kos">,</span> <span class="pl-s1">data</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-c">// this will output [{foo: 'bar'}, {foo: 'bar'}, {foo: 'bar'}];</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Then the proper information will be received.</p>
<p dir="auto">I'm not sure if this is a problem with Chromium, and how virtual address space between threads is propagated when sending information between two processes, but clearly a collection of the same object references struggles to be passed around unless they are all distinct references.</p>