title: Bokeh PATCH-DOC ping-pong resets plots
body: <p>Our dashboard has three relatively data-hungry plots: </p>
  
  <ul>
  <li>two image plots (200x200x3) </li>
  <li>custom extension tool plot (200x200x4).</li>
  </ul>
  
  <p>We 'update' (send data to) them from <code>doc.add_next_tick_callback</code>s. We are hitting a weird situation where the <code>image</code> plots appear to be working for a split second and then a websocket message comes which erases everything in their buffer.</p>
  
  <p>We traced frontend and backend and it seems that:</p>
  
  <ul>
  <li>frontend gets initialized with empty buffers (good)</li>
  <li>frontend sends a PATCH-DOC back with empty buffers</li>
  <li>in the meantime the actual-data update arrives from the server (which makes images work for a split second)</li>
  <li>finally the empty PATCH-DOC gets pinged back to frontend resetting our figures.</li>
  </ul>
  
  <p>We did extensive reading of the frontend codebase, and found that when we removed</p>
  
  <p><code>this.send(patch_message)</code></p>
  
  <p>from <code>connection.ts</code> line 166, our problem is gone.</p>
  
  <p>What could be causing this ping/pong behaviour? </p>
  
  <p>Could this be a bug or did we do something wrong?</p>
  
  <p>Tested on Bokeh version 1.0.4</p>